Why does a class containing a method call to a missing Interface within unused code cause a Java class loading error?
问题 I'm seeing some class loading behavior that appears to be inconsistent with the JVM spec and am wondering if this is a bug. Or if not, hoping someone can explain why. The example code found below simply prints hello from its main method. It has an unused method that contains a method call to a method that declares it takes a 'C' (which is an interface) as an argument. When the main is executed (without A, B, and C in the class path) a ClassNotFound Error is thrown for Interface C. (Note C is