Java MCQs - All MCQs
History, JVM, JRE and JDK, Variables, Data Types, Operators, Control Statements, Iterative Statements, Object Class, Naming conventions, Constructors
1. What is a class in Java?
A. static reference
B. template or blueprint
C. instance of class
D. None of above
2. What is the correct output of this program ?
A. A greater than B
B. A less than B
C. A greater than B OR A less than B
D. Valid Condition
3. What the naming convention should be for Packages in Java?
A. It should be a lowercase letter such as java, lang
B. If the name contains multiple words, it should be separated by dots (.) such as java.util, java.lang
C. All of above
4. What is the correct output of this program ?
A. Run time Error
B. Compile time error
C. 70 69 68 67 66 65 64 63 62 61
D. 70 69 68 67 66 65 64 63 62
5. If condition is false then ?
A. Block of If condition will be executed
B. Block of If condition will not be executed
C. Block of Else will be executed (If exists)
D. Both B & A
6. An statement that checks the equality only ?
C. If and Switch
7. What is the default value of double ?
8. Which are the object characteristics?
D. All of above
9. When Sun Micro-systems released the first public implementation as Java 1.0?
10. Which are the non-primitive data types ?
D. All of Above