Java Quiz Lesson 5
Java Quiz Lesson 5
Answer: B) HashMap allows one null key and multiple null values.
A) Thread.stop()
B) Thread.suspend()
C) Thread.interrupt()
D) Thread.finish()
Answer: C) Thread.interrupt()
B) StringBuffer
C) StringBuilder
System.out.println(arr[0]);
A) 0
B) null
C) ArrayIndexOutOfBoundsException
D) Compilation error
Answer: A) 0
Explanation: In Java, arrays of primitive types like int are initialized with
default values. For int, the default value is 0.
9. Which of the following statements is true about the public access modifier
in Java?
B) It allows access to the class or member from any other class in any
package.
10. Which of the following statements is true about the super keyword in
Java?