posted 21 years ago
hi,
i think, an anonymous class DOES NOT ALWAYS extend Object. it only does so when it implements an interface.
return new Runnable()... ; implicitly extends object. when an interface does not extends another interface, it implicitly extends object
return new MyClass ()....; extends MyClass (only).
As for as the Object being at top of hierrarchy is concerned, we can not say, in technical sence, that all classes extend from object
class Child extends Parent(){}
Child only extends Parent and not Object, because it can extend only one class). though ANY class IS-A object is valid.
further it is worth noting that explicitly stating 'extends Object' for anonymous class in not allowed.
if i am wrong, plz correct.