You create an anonymous inner class that is a subclass of MyObject , so yes, you override the doThing method if that is what you are asking for.
By the way, anonymous classes are similar to named classes, they have their own bytecode in their .class file, which is named as their spanning class with a dollar suffix and a number.
If you want to experiment yourself, you can use the getClass() of MyObject method and extract information about it, for example, name, parent, implemented interfaces, general arguments, etc.
source share