Anything declared inside a method is local to the method. class MyClass { public void aMethod() { class InnerClass { } } }