Can anyone give an example for the below statement
anonymous inner class have no name and there type must be either a subclass of the named type or an implementer of the named interface. Can anyone give an example for both class and an interface.
Thanks in advance
SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
The same pattern applies for interfaces as for classes, either abstract or classic.
This example ilustrates, that anonymous class passed as an argument to Thread constructor has no name and is decendant/implementor of Runnable (regardless it is a class or interface).
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad: