Java multiple choice questions answers pdf | Java interview questions

In this page you will get all the important and most frequently asked questions in aptitude, technical interview and GATE exams.

01) What is the output of relational operators?

  1. Boolean
  2. Integer
  3. Char
  4. none of the above

Correct answer: Boolean

02) Which of the below have the highest precedence?

  1. *
  2. ()
  3. ++
  4. None of the above

Correct answer: ()

03) Which of the below statements test only for equality?

  1. Switch
  2. if
  3. if & switch
  4. None of the above

Correct answer: switch

04) While loop repeats a set of code while the condition is not met?

  1. True
  2. False
  3. None of the above

Correct answer: False

05) Which of the below following is not OOPS concept in JAVA?

  1. Encapsulation
  2. Inheritance
  3. Polymorphism
  4. Compilation

Correct answer: Compilation( Four OOP concept is IEPA-(Inheritance, Encapsulation, Polymorphism, Abstraction)

06) Which component is used to compile, debug and execute JAVA program?

  1. JDK
  2. JVM
  3. JIT
  4. JRE

Correct answer: JDK(Java Development Kit)

07) What is stored in the object ob in the below following line of java code?

Circle ob;

  1. Memory address of allocated memory of object
  2. Any arbitrary pointer
  3. NULL
  4. None of the above

Correct answer: NULL

08) What is the return type of a method that does not return any value?

  1. void
  2. int
  3. float
  4. none of the above

Correct answer: void

09) What is the return type of constructors?

  1. int
  2. char
  3. float and double
  4. None of the above

Correct answer: None of the above( Constructors does not have any return type)

10) Which of the below have highest memory requirement?

  1. JVM
  2. Heap
  3. Stack
  4. Class

Correct answer: JVM