ProgrammingHardStatement-count style · Product-company MCQ pattern

How many of these are correct in Java (8 or later)? (i) An abstract class can have a constructor. (ii) An interface can declare instance (non-static) fields. (iii) A class can extend only one class but implement many interfaces. (iv) An interface can have static methods with a body.

  1. A. Only one
  2. B. Only two
  3. C. Only three
  4. D. All four

Correct answer: C. Only three

(i) true: it runs when a subclass object is created. (ii) false: interface fields are always public static final. (iii) true. (iv) true since Java 8. So three.

More OOP with C++ and Java questions

Exams that ask this topic