CoreJava3
CoreJava3
/* // */
1. No the block comment(/*...*/) is not ended since the single-line
comments(//...)comments out the closing part.
2. It is completely valid comment.The // part is ignored by the compiler.
3. This is combination of comments is illegal and the compiler will reject
it.
4. None of above
Correct Answer : 2
Your Answer :
QuestionID : 9570 Subject Name Core Java
Q20. Which of the following is not a wrapper class
1. String
2. Integer
3. Boolean
4. character
Correct Answer : 1
Your Answer :
QuestionID : 9589 Subject Name Core Java
Q21. In the following code,A and D will compile without any error.
A.StringBuffer sbl="abcd";
B.Boolean b = new Boolean("abcd");
C.byte b=255;
D.int x=0x1234;
E.float f1=1.2;
Correct Answer : F
Your Answer :
QuestionID : 9650 Subject Name Core Java
Q22. Which of the following are valid runtime options?
1. -enableassertions
2. -source 1.4
3. -disablesystemassertions
4. (1) and (3)
Correct Answer : 4
Your Answer :
QuestionID : 9651 Subject Name Core Java
Q23. class Test
{
Test(int i)
{
System.out.println("Test("+i+")");
}
};
public class test1
{
static Test t1=new Test(1);
Test t2=new Test(2);
static Test t3=new Test(3);
public static void main(String[] args)
{
test1 t=new test1();
System.out.println("Hello World!");
}
}
1. Test(1)
Test(2)
Test(3)
2. Test(3)
Test(2)
Test(1)
3. Test(2)
Test(1)
Test(3)
4. Test(1)
Test(3)
Test(2)
Correct Answer : 4
Your Answer :
QuestionID : 9653 Subject Name Core Java
Q24. Read this piece of code carefully
if("String".replace(`T`,`t`)=="String")
System.out.println("equal");
else
System.out.println("not equal");
1: int i = 45678;
2: int j = ~i;
3:
4: System.out.println(j);
1. Compilation error at line 2. ~ operator applicable to boolean values
only.
2. Prints 45677.
3. Prints -45677.
4. Prints -45679.
Correct Answer : 4
Your Answer :
QuestionID : 10053 Subject Name Core Java
Q39. A Monitor is an object that is used as mutually exclusive lock.
Correct Answer : T
Your Answer :
QuestionID : 10092 Subject Name Core Java
Q40. How are remote object parameters transferred between client and
server?
1. A proprietary protocol that is determined by the vendor of the RMI
implementation
2. Standard Java Serialization
3. Internet Inter-ORB protocol(IIOP)
4. Java Remote Method Protocol(JRMP)
Correct Answer : 2
Your Answer :
QuestionID : 10113 Subject Name Core Java
Q41. What is the result of executing the following code, using the parameters
4 and 0:
try {
int c = a / b;
} catch (Exception e) {
System.out.print("Exception ");
} finally {
System.out.println("Finally");