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. A variable declared inside the method is known as

A. Instance Variable

B. Class Variable

C. Local Variable

Answer: C

2. Java naming convention is a suggestion only to follow

A. true

B. false

Answer: A

3. What is the right output of this program ?

A. true

B. false

Answer: A

4. What the naming convention should be for Interfaces in Java?

A. It should start with the uppercase letter.

B. It should be an adjective such as Intelligent, Acceptable

C. Use appropriate words, instead of acronyms.

D. All of above

Answer: D

5. Which kind of Java programming is?

A. Procedural

B. Non-Procedural

C. Object Oriented

D. Event Driven

Answer: C

6. State characteristic of an object represents

A. the data of an object

B. the behaviors or actions of an object

C. the internal unique identity of an object

D. All of above

Answer: A

7. Which are the assignment operators ?

A. = += -= *= /= %=

B. &= ^= |=

C. <<= >>= >>>=

D. All of Above

Answer: D

8. JDK stands for ?

A. Java Development Kit

B. Java Virtual Machine

C. Java Run-time Environment

D. None of Above

Answer: A

9. What is the correct output of this program ?

A. 1 2 3 4 5 6 7 8 9 10

B. 0 1 2 3 4 5 6 7 8 9 10

C. 1 2 3 4 5 6 7 8 9 10 11

D. None of above

Answer: A

10. What is the correct output of this program ?

A. 2 4 6 8 10

B. Compile time error

C. Infinite Loop

D. None

Answer: A