here is the code
public class ClassResolution {
static class Parent {
public static String name;
static {
System.out.println(\"this is Parent
Oops, I was wrong, the reference to Child was not removed and the class was really loaded, but not initialized. Congratulations, you have found a JVM bug. Go to Oracle site and file it. Let me know if you don't want to do so, I'll do it myself.
EDIT: I was wrong again, see comment below. This is not a bug, this is a "gotcha".