COrejava6
COrejava6
}
select the one answer
1. the code will fail to compile since the compiler will recognize that the
variable c in the assignment statement a=b=c=20;has not been initialized
2. the code will fail to compile because the assignment statement
a=b=c=20;is illegal.
3. the code will compile correctly and will display 10 when run
4. the code will compile correctly and display 20 when run
Correct Answer : 4
Your Answer :
QuestionID : 9627 Subject Name Core Java
Q42. which of following statements are true?
1. At root of the Collection hierarchy is class called collection
2. the collection interface contains a method called enumerator
3. the iterator method returns an instance of the Vector class
4. The Set interface is designed for unique elements
Correct Answer : 4
Your Answer :
QuestionID : 9639 Subject Name Core Java
Q43. what will the result of attempting to compile and run the following prog.
A) "john" == "john"
B) "john".equals("john")
C) "john" = "john"
D) both A and B
1. A
2. B
3. C
4. D
Correct Answer : 4
Your Answer :
QuestionID : 9850 Subject Name Core Java
Q56. Which mostly closely matches a description of java map?
1. a vector of array for 2D geographic represtation
2. A class for containing unique array element
3. A class for containing unique vector element
4. An interface that ensure that implementing class cannot duplicate keys
Correct Answer : 4
Your Answer :
QuestionID : 9884 Subject Name Core Java
Q57. The following code will print
1: int i = 1;
2: i <<= 31;
3: i >>= 31;
4: i >>= 1;
5:
6: int j = 1;
7: j >>= 31;
8: j >>= 31;
9:
10: System.out.println("i = " +i );
11: System.out.println("j = " +j);
1. i = 1
j=1
2. i = -1
j=1
3. i = 1
j = -1
4. i = -1
j=0
Correct Answer : 4
Your Answer :
QuestionID : 9885 Subject Name Core Java
Q58. Given the following classes defined in separate files:
class Vehicle{
public void drive(){
System.out.println("Vehicle: drive");
}
}
What will be the effect of compiling and running this class Test?
1. Generates a Compiler error on the statement v= c;
2. Generates runtime error on the statement v= c;
3. Prints out:
Vehicle: drive
Car: drive
Car: drive
4. Prints out:
Vehicle: drive
Car: drive
Vehicle: drive
Correct Answer : 3
Your Answer :
QuestionID : 9886 Subject Name Core Java
Q59. An anonymous class provides________interface implementation and
___
arguments are passed.
1. single,0
2. single,1
3. multiple,0
4. multiple,1
Correct Answer : 1
Your Answer :
QuestionID : 9904 Subject Name Core Java
Q60. class test
{
public static void main(String[] args)
{
int i=10;
int j=20;
System.out.println(i++ + ++j + i++);
}
}
1. 41
2. 42
3. 40
4. 43
Correct Answer : 2
Your Answer :
QuestionID : 9907 Subject Name Core Java
Q61. A reference type or object can never be casted to primitive type.
Correct Answer : T
Your Answer :
QuestionID : 9908 Subject Name Core Java
Q62. Nested classes were allowed by original 1.0 specification for java.
Correct Answer : F
Your Answer :
QuestionID : 9920 Subject Name Core Java
Q63. What will be the output?
class abc
{
public static void main(String[] args)
{
String str=new String("Hello");
str.concat("Hi");
System.out.println(str);
}
}
1. Hi
2. HelloHi
3. Hello
4. Compile Error-no method like concat().
Correct Answer : 3
Your Answer :
QuestionID : 9925 Subject Name Core Java
Q64. Once string object is created, its contents cannot be altered.
Correct Answer : T
Your Answer :
QuestionID : 9929 Subject Name Core Java
Q65. Which of the following do not lead to a runtime error?
1. i,iii
2. i,iv
3. i,iii,iv
4. i,ii,iii,iv
Correct Answer : 3
Your Answer :
QuestionID : 10105 Subject Name Core Java
Q79. Asuume any exception handling has been set up,which of the following
will create an instance of the RandomAcess File class
1. RandomAcessFile raf=new RandomAcessFile("myfile.txt","rw");
2. RandomAcessFile raf=new RandomAcessFile(new
DataInputStream());
3. RandomAcessFile raf=new RandomAcessFile("myfile.txt");
4. RandomAcessFile raf=new RandomAcessFile(new Fle("myfile.txt"));
Correct Answer : 1
Your Answer :
QuestionID : 10114 Subject Name Core Java
Q80. Which of the following statments are true?
1. A method can not be overloaded to be less public in a child class
2. To be overridden a method must have the same name and the
parameter and return types
3. To be overridden a method only needs the same name and the
parameter types
4. To be overridden a method must have the same name and the
parameter names and return types
Correct Answer : 2
Your Answer :
QuestionID : 10134 Subject Name Core Java
Q81. static inner class object can be created inside its outer class.
Correct Answer : T
Your Answer :
QuestionID : 10202 Subject Name Core Java
Q82. Select true statement
a>new & delete are keywords in Java
b>return,goto & default are keywords in Java
c>static,unsigned & long are keywords in Java
d>try,catch & thrown are keywords in Java
1. a,b,c
2. a,b
3. only b
4. only d
Correct Answer : 3
Your Answer :
QuestionID : 10206 Subject Name Core Java
Q83. which of these are core interfaces in collection framework
1. set,collection,map
2. bag
3. linkedlist
4. none
Correct Answer : 1
Your Answer :
QuestionID : 10244 Subject Name Core Java
Q84. What will be output;
class test
{ static int k;
public static void main(String[] args)
{ int i=10,j=5,l=6;
k= i < j?i:i > l?1:0;
System.out.println(k);
}
}
1. 0
2. 1
3. 10
4. 6
Correct Answer : 2
Your Answer :
QuestionID : 10275 Subject Name Core Java
Q85. Which colour is used to indicate instance methods in the standard
"javadoc" format documentation:
1. blue
2. red
3. purple
4. orange
Correct Answer : 2
Your Answer :
QuestionID : 10460 Subject Name Core Java
Q86. ________ Class is Super class for all java exception classes
1. Throwable
2. Throw
3. ThrowsException
4. all
Correct Answer : 1
Your Answer :
QuestionID : 10462 Subject Name Core Java
Q87. Inner class in java can be Static?
Correct Answer : T
Your Answer :
QuestionID : 10486 Subject Name Core Java
Q88. UDP is connectionless protocol
Correct Answer : T
Your Answer :
QuestionID : 10487 Subject Name Core Java
Q89. To create the TCP-IP stream transport layer is responsibe
Correct Answer : F
Your Answer :
QuestionID : 10491 Subject Name Core Java
Q90. When an applet begins awt call following sequence of method.
1. init(),paint(),destroy
2. init(),start(),paint(),stop(),destroy
3. init(),service(),destroy
4. init(),start(),stop(),destroy
Correct Answer : 2
Your Answer :
QuestionID : 10496 Subject Name Core Java
Q91. name of class file of inner class contain which of the
following character.
1. %
2. @
3. $
4. none of the above.
Correct Answer : 3
Your Answer :
QuestionID : 10508 Subject Name Core Java
Q92. What is the output of the following program?
class test
{
int i=(int)34.3E38
System.out.println(i);
}
1. It is equal to maximum value of the integer;
2. It gives Runtime Error.Value is greator than limits of Integer .
3. It gives Compile time error.Value is greator than limits of Integer.
4. 343000000
Correct Answer : 1
Your Answer :
QuestionID : 10514 Subject Name Core Java
Q93. Read object method reconstructs object at the time of retriving from the
file.
1. bit by bit
2. Byte by Byte
3. Whole object at a time.
4. Element by Element
Correct Answer : 2
Your Answer :
QuestionID : 10973 Subject Name Core Java
Q94. RandomAccess is a marker interface used by List implementations to
indicate that they support fast random access.
Correct Answer : T
Your Answer :
QuestionID : 10975 Subject Name Core Java
Q95. Which of the following methods will give you an error when placed at
line no 10?
Select one correct answer.
1 class A
2{
3 public void callme()
4{
5 System.out.println("A");
6}
7}
8 class B extends A
9{
10 //Here
11 }
1. public final void callme() {}
2. void callMe() {}
3. void callme(int a) {}
4. void callme() {}
Correct Answer : 4
Your Answer :
QuestionID : 10980 Subject Name Core Java
Q96. Which of the following a valid adapter class?
1. ActionAdapter
2. AdjustmentAdapter
3. KeyAdapter
4. TextAdapter
Correct Answer : 3
Your Answer :
QuestionID : 10989 Subject Name Core Java
Q97. Every Applate that u create must be a subclass of Applate
Correct Answer : T
Your Answer :
QuestionID : 10993 Subject Name Core Java
Q98. methods in interface can be static
Correct Answer : F
Your Answer :
QuestionID : 10996 Subject Name Core Java
Q99. inner classes can access only static members of outer class
Correct Answer : F
Your Answer :
QuestionID : 11004 Subject Name Core Java
Q100. Dictinary is a class of java.util package
Correct Answer : T
Your Answer :