When is an interface with a default method initialized?
问题 While searching through the Java Language Specification to answer this question, I learned that Before a class is initialized, its direct superclass must be initialized, but interfaces implemented by the class are not initialized. Similarly, the superinterfaces of an interface are not initialized before the interface is initialized. For my own curiosity, I tried it and, as expected, the interface InterfaceType was not initialized. public class Example { public static void main(String[] args)