from the k&b void makeBar() { (new Bar(){}).go(); } Is this is method local inner class or an anonymous class? If its anonymous how is it being declared inside a method? what exactly is going on here?
Adding some code around the fragment that you have given, to give it some contextual meaning
Observe that inside the makebar() method, we are creating an anonymous inner class, which is the subclass of class Sample. This inner class doesnot override any methods from the superclass. And then we just call the go() method on the newly created instance.