Java OCA OCP Practice Question 1175

Question

The keyword extends refers to what type of relationship?

  • A. "is a"
  • B. "has a"
  • C. "was a"
  • D. "will be a"
  • E. None of the above


A.

Note

The keyword extends is used when referring to another class.

The extending class will have access to all the available methods(non-private methods) in the extended class.

The methods may be called as though they are defined in the extending class.

If the extending class defines a method that exists in the extended class, that method is said to be overridden in the extending class.

Because the extending class does not have to define any of the methods available in the extended class, it is said that the subclass X "is a" Y.




PreviousNext

Related