Java OCA OCP Practice Question 76

Question

Suppose interface Inty defines five methods.

Suppose class Classy declares that it implements Inty but does not provide implementations for any of the five interface methods.

Which is/are true?

  • A. The class will not compile.
  • B. The class will compile if it is declared public.
  • C. The class will compile if it is declared abstract.
  • D. The class may not be instantiated.


C, D.

Note

If a class does not provide implementations for all methods of all interfaces that the class declares it implements, that class must be declared abstract.

Abstract classes may not be instantiated.




PreviousNext

Related