Good catch, Cindy. I was wrong about the JVM's knowledge of access modifiers - I seem to recall there are cases where the JVM seems to know less about access than the compiler, but details are fuzzy in my memory right now and I don't have time to
test. But contrary to me earlier statement, access modifiers
are part of the class files, and the JVM is expected to enforce them. But of course, if the class file is out of date, strange things can happen...