MCQ on Java keywords

Q) In java, “this” keyword is used to
  1. Pass as an argument to a method.
  2. Refer current class object.
  3. Return current class object.
  4. All are correct.

Answer: 4


 
Q) Which keyword is used to refer current object of a class in Java?
  1. this
  2. new
  3. current
  4. None

Answer: 1


 
Q) try, catch, finally, throw, and throws keywords in java are related to
  1. Event handling
  2. string handling
  3. exception handling
  4. None of the above

Answer: 3


Q) Super keyword in java is used to
  1. refer current class object.
  2. refer static method of the class.
  3. refer parent class object.
  4. refer static variable of the class.

Answer: 3


 
Q) Transient keyword in java is used in
  1. serialization
  2. synchronization
  3. inheritance
  4. polymorphism

Answer: 1
Transient keyword in java is a variables modifier used in serialization. If we define any class field as transient, then it will not be serialized.


MCQ on Java keywords

Scroll to top