Java Programming Quiz
Java Programming Quiz contain set of 10 MCQ questions for Java Programming MCQ which will help you to clear beginner level quiz.
1. Which is a reserved word in the Java programming language?
A. method
B. native
C. subclasses
D. Reference
2. Which is a valid keyword in java?
A. interface
B. string
C. Float
D. unsigned
3. What is the numerical range of a char?
A. -128 to 127
B. -(215) to (215) – 1
C. 0 to 32767
D. 0 to 65535
4. Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
A. java.lang.String
B. java.lang.Double
C. java.lang.StringBuffer
D. java.lang.Character
5. Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?
A. java.util.HashSet
B. java.util.LinkedHashSet
C. java.util.List
D. java.util.ArrayList
6. Which interface does java.util.Hashtable implement?
A. Java.util.Map
B. Java.util.List
C. Java.util.HashTable
D. Java.util.Collection
7. What is the name of the method used to start a thread execution?
A. init();
B. start();
C. run();
D. resume();
8. Which two of the following methods are defined in class Thread?
1. start()
2. wait()
3. notify()
4. run()
5. terminate()
A. 1 and 4
B. 2 and 3
C. 3 and 4
D. 2 and 4
9. Which will contain the body of the thread?
A. run();
B. start();
C. stop();
D. main();
10. Which of the following will not directly cause a thread to stop?
A. notify()
B. wait()
C. InputStream access
D. sleep()