I guess you expected the local class method to be invoked. That didn’t happen, because you’re using new A() outside the scope of local class. So, it accesses the next closer candidate in scope, that would be the inner class. From JLS §6.3:
The scope of a local class declaration immediately enclosed by a block (§14.2) is the rest of the immediately enclosing block, including its own class declaration.
Thus, new A() in the first line of method, will not access the local class appearing after it. If you move the class declaration before that, you’ll get the expected output.
Also see JLS §14.3, which contains similar example.