Java OCA OCP Practice Question 85

Question

Suppose class A has a method called doSomething(), with default access.

Suppose class B extends A and overrides doSomething().

Which access modes may apply to B's version of doSomething()? (Choose all that apply.)

  • A. public
  • B. private
  • C. protected
  • D. Default


A, C, D.

Note

An overriding method's access mode must be the same as, or more open than, the superclass version's access mode.




PreviousNext

Related