The above code is from a book. I'm unable to understand what the author means by " In the non-static method, the reference to the instance of the enclosing context is passed implicitly in the constructor call of the non-static local class at (6). "
Now my question is - is there some specification about how class files would be named once we define inner classes - like it shows $ as a seperator; and $1 as a seperator for local classes?
$ followed by an integer is used for local classes because you can declare multiple local classes with the same name, in different methods. The following code adds a definition of local class 'InsideMethod' in 'method2()':
When you compile the above class, the Java compiler will generate the following class files for the local inner classes 'InsideMethod' defined in 'method()' and 'method2()':