Home
MCQs
Java MCQs
All MCQs
Java MCQs

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 the correct output of this program ?

A. Run time Error

B. Compile time error

C. Hello Loop

D. Infinite Loop

Answer: D

2. JVM stands for ?

A. Java Development Kit

B. Java Virtual Machine

C. Java Run-time Environment

D. Java Verified Machine

Answer: B

3. Which are the invalid variable names ?

A. 1stLevel

B. first Level

C. *firstLevel

D. All of Above

Answer: D

4. What is the correct output of this program ?

A. 10987654321

B. 987654321

C. 123456789

D. 12345678910

Answer: A

5. Which is not a primitive data type?

A. Boolean

B. Character

C. Arrays

D. Integer

Answer: C

6. What is the default size of short ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: B

7. What is the correct output of this program ?

A. Basic Subjects

B. Java Subjects

C. Microsoft Subjects

D. Default

Answer: B

8. Which are the arithmetic operators ?

A. * / %

B. + -

C. All of above

Answer: C

9. What is the correct output of this program ?

A. A greater than B

B. A less equals to B

C. Else condition

Answer: C

10. What is the functionality of break statement?

A. To terminate current iteration

B. To continue current iteration

C. To terminate main flow

D. To continue main flow

Answer: A