Yes.
The class you created inside the main() is a method local inner class.
There is a special case with the method local inner classes.I recommend you to go through the static inner class, method local inner class and the anonymous inner and argument-defined anonymous inner class in deep.
They are very important concepts of
Java and are very helpful in certain cases.
Hope this helps.