Professional Documents
Culture Documents
Day 1 Quiz
Day 1 Quiz
Answer: b
Answer: a
a) 786
b) Compile Time Error
c) Run Time Error
d) None of the above
Answer: b
}
a) Right
b) ABCD
c) Compile Time Error
d) Nothing will be Printed
Answer: d
if(str1 == str2)
{
System.out.println("Right");
}
if(str2==str3){
System.out.println("Left");
}
if(str3.equals(str4)){
System.out.println("Centre");
}
a) Right, Left
b) Left, Centre
c) Right, Centre
d) Right, Left, Centre
Answer: c
6. What is the correct way of declaring an array?
1) int[] x = new int[5];
2) int[] x = new int[‘a’];
3) int [] x = new int[-1];
4) int[] x = new int[32768]
a) 1,2,4
b) 1,2
c) 1,2,3
d) 1,4
Answer: b
a) Exception class
b) Thread class
c) HashMap class
d) Object class
Answer: d
Answer: c
Answer: b
10. What are the advantages of having wrapper classes in Java for primitive data types?
Answer: a