Which two of these interface declarations compile?
Interface default methods may have bodies, while ordinary public interface methods may be abstract. Interface fields are implicitly public, static, and final, so explicitly declaring those modifiers is valid. Private interface methods are also allowed when they provide a body. Therefore, the valid declarations are A and D.
Community Discussion