Java OCA OCP Practice Question 88

Question

True or false:

  • If class Y extends class X,
  • the two classes are in different packages,
  • and class X has a protected method called abby(),
  • then any instance of Y may call the abby() method of any other instance of Y.
  • A. True
  • B. False


B.

Note

An object that inherits a protected method from a superclass in a different package may call that method on itself but not on other instances of the same class.




PreviousNext

Related