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

101. What is a Java development kit (JDK) ?

A. It is a set of libraries with a Java runtime environment.

B. It is a just development tool.

C. It is a development tool with a Java runtime environment.

D. It is a just runtime environment.

Answer: C

102. A variable declared inside the method is known as

A. Instance Variable

B. Class Variable

C. Local Variable

Answer: C

103. 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. Invalid Condition

Answer: C

104. Where to declare class variables ?

A. It declares inside the class and outside of method.

B. It declares inside the class with static prefix and outside of method.

C. It declares inside the method.

Answer: B

105. What is the correct output of this program ?

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

B. None

C. 1 3 5 7 9

D. Infinite Loop

Answer: C

106. Constructor name and class name can be different in java?

A. Yes

B. No

Answer: B

107. A name of variable is known as

A. Data Type

B. Constant

C. Identifier

Answer: C

108. Which are the logical operators ?

A. &&

B. ||

C. All of above

D. None of Above

Answer: C

109. What is the correct output of this program ?

A. Compile time Error

B. Run time Error

C. If condition true

Answer: C

110. Who is the founder of Java?

A. Dennis Ritchie

B. James Gosling

C. Rasmus Lerdorf

D. Brendan Eich

Answer: B