Alright so, its also the case that if A depends on...
# announcements
g
Alright so, its also the case that if A depends on B statically, and B encounters an exception in its static initializer, and the runtime calls
A.main
as its entry point, the only thing you'll see is
NoClassDefFoundError: Cannot find 'com.you.A'
correct? without a caused-by
ExceptionInInitializer
?
k
That's just a Java question then, but I can't get it to happen with something like this:
Copy code
public class A extends B {
    public static void main(String[] args) {
        System.out.println("Hello world");
    }
}

public class B {
    static {
        if (true) {
            throw new RuntimeException();
        }
    }
}