Java OCA OCP Practice Question 2350

Question

Which of the following statements are correct? (Choose all that apply.)

  • a An abstract class must define variables to store the state of its object.
  • b An abstract class might define concrete methods.
  • c An abstract class might not define abstract methods.
  • d An abstract class constructor might be called by its derived class.
  • e An abstract class can extend another nonabstract class.
  • f An abstract class can't define static final abstract methods.


b, c, e, f

Note

Note the use of can, must, and might or might not in these options.

Note that this isn't a test on English grammar or vocabulary.

The meaning of an exam question will completely change depending on whether it uses "can" (feasible), "must" (mandatory), or "might" (optional) in a question.

Option (a) is incorrect because it isn't mandatory for an abstract class to define instance variables.

Option (d) is incorrect because the constructor of all base classes-concrete or abstract-must be called by their derived classes.

Option (f) is a correct statement.

The combination of final and abstract modifiers is incorrect.

An abstract method is meant to be overridden in the derived classes, whereas a final method can't be overridden.




PreviousNext

Related