Java Programming Online Test – Multiple Choice Questions and Answers

1. Which interface does java.util.Hashtable implement?

 
 
 
 

2. Which of the following are Java reserved words?
run import default implement

 
 
 
 

3. Which collection class allows you to access its elements by associating a key with an element’s value, and provides synchronization?

 
 
 
 

4. Which of the following will directly stop the execution of a Thread?

 
 
 
 

5. What is the numerical range of char?

 
 
 
 

6. Which class or interface defines the wait(), notify(),and notifyAll() methods?

 
 
 
 

7. You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?

 
 
 
 

8. Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?

 
 
 
 

9. Which of the following statements about the hashcode() method are incorrect?
The value returned by hashcode() is used in some collection classes to help locate objects. The hashcode() method is required to return a positive int value. The hashcode() method in the String class is the one inherited from Object. Two new empty String objects will produce identical hashcodes

 
 
 
 

10. Which method registers a thread in a thread scheduler?

 
 
 
 

Question 1 of 10

Leave a Reply

Your email address will not be published. Required fields are marked *