Java OCA OCP Practice Question 2362

Question

Select the correct statements. (Choose all that apply.).

  • a An abstract class can't define static final variables.
  • b The abstract methods defined in an abstract base class must be implemented by all its derived classes.
  • c An abstract class enforces all its concrete derived classes to implement its abstract behavior.
  • d An abstract class might not define static methods.
  • e The initialization of the final variables defined in an abstract base class can be deferred to its derived classes.


c, d

Note

Option (a) is incorrect.

An abstract class can define static final variables.

Option (b) is incorrect.

The abstract methods defined in an abstract base class must be implemented by all its concrete derived classes.

Abstract derived classes might not implement the abstract methods from their abstract base class.

Option (e) is incorrect.

The initialization of a final variable defined in an abstract base class must complete in the class itself-with its initialization, in its initializer block, or in its constructor.

It can't be deferred to its derived class.




PreviousNext

Related