Java Inner class shadowing external class
问题 I took the following code from the K&B book "SCJP Sun Certified Programmer for Java 6 Study Guide": class A { // 1 void m() { System.out.println("outer"); } } public class TestInners { public static void main(String[] args) { new TestInners().go(); } void go() { new A().m(); class A { // 2 void m() { System.out.println("inner"); } } } class A { // 3 void m() { System.out.println("middle"); } } } As stated in the book, this code prints "middle". I infer that the class declaration marked as "3"