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

81. What is the correct output of this program ?

A. A2 A2 A3 Default

B. A2

C. A2 A3 Default

D. Default

Answer: C

82. Which are the logical operators ?

A. &&

B. ||

C. All of above

D. None of Above

Answer: C

83. 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

84. What is the correct output of this program ?

A. Run time Error

B. Compile time error

C. Hello Loop

D. Infinite Loop

Answer: D

85. What is the correct output of this program ?

A. A greater than B

B. A less equals to B

C. Else condition

Answer: C

86. What will be the output of following program?

A. 0123456789

B. 02468

C. 0246810

D. 123456789

Answer: B

87. What is the default size of long ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: D

88. What is nested loop?

A. A Loop with empty initialization

B. A Loop within a Loop

C. A Loop without condition

D. All of above

Answer: B

89. What is the default value of short ?

A. 0 default value

B. 0s default value

C. 0.0 default value

D. 0.0f default value

Answer: A

90. What is the default value of byte ?

A. 0 default value

B. 0b default value

C. 0.0 default value

D. 0.0f default value

Answer: A