MCQ on Java keywords


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
View Answer
Answer: C

 

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.
View Answer
Answer: C

Q) Transient keyword in java is used in
  1. serialization
  2. synchronization
  3. inheritance
  4. polymorphism
View Answer
Answer: A
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.



Leave a Comment