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

51. What is the right output of this program ?

A. 6765

B. 5654

C. 5775

D. 5765

Answer: C

52. Where to declare instance 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: A

53. new keyword is used for?

A. allocating memory at runtime

B. allocating memory at compile time

C. releasing memory at runtime

D. All of above

Answer: A

54. Which are the unary operators ?

A. ++

B. --

C. Both of above

Answer: C

55. What is an object in Java?

A. static reference

B. template or blueprint

C. instance of class

D. None of above

Answer: C

56. What is empty loop in Java?

A. It has empty initialization clause

B. It has empty conditional clause

C. It has empty increment clause

D. All of above

Answer: D

57. What is the default size of float ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: C

58. What is the correct output of this program ?

A. Compile time Error

B. A equals to B

C. A is not equals to B

Answer: B

59. Enterprise Applications are known as

A. Distributed applications

B. Server side applications or Web applications

C. Desktop applications or Window-based applications

D. Android applications or Java ME applications

Answer: A

60. Which are the Shift operators ?

A. >>>

B. >>

C. <<

D. All of Above

Answer: D