Hello,
Actually, it won't be able to invoke the pop_test() method i suppose.
If you see this part of code.
It says that inside class
Test, declare a reference variable of type Annonymous, then declare a new class that has no name but is the
subclass of Anonymous. The whole point to declare such classes is to override the methods of the super-class that is Anonymous.
It should be noted that you are using a super-class reference to refer to the sub-class object. There are potential limitations to this.
You can only call those methods on an anonymous inner class that are defined the reference variable type.
Spot the problem here, in this anonymous class, rather then overriding the method you are declaring a new method called pop_test,
but the reference type is of Super class and super class won't know anything about this method. That is a potential limitation in this case.
Hope this helps,