MCQ on Java keywords

Q) Final keyword in java is used with
  1. class
  2. class fields
  3. class methods
  4. All of the above
View Answer

Q) False statement about final method in java
  1. Value of final variable cannot be changed once initialized.
  2. Final method is inherited but we cannot override it
  3. If you make a class final then you cannot extend the class
  4. Constructor can be declared as final.
View Answer

Q) Super keyword in java is used to
  1. Refer immediate parent class instance variables.
  2. Invoke immediate parent class methods.
  3. Invoke immediate parent class constructor.
  4. All
View Answer

Q) True statement about extending a class in java is
  1. A class can extends only one another class
  2. A class can extends multiple classes.
  3. A class can extends multiple interfaces.
  4. None
View Answer

Read More