Skip to content
CodeKruPro

Rules for interfaces in Java 21

QuizMediumJava onlyAsked in: Accenture, Capgemini, Infosys, TCS, Wipro

Which statements about Java 21 interfaces are true? Pick all that apply.

  • A field declared in an interface is implicitly public static final
  • An interface can have default and static methods with bodies
  • An interface can have private methods
  • An interface can declare a constructor
  • An abstract class must declare at least one abstract method

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in