aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes anonymous classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "anonymous classes" Watch "anonymous classes" New topic
Author

anonymous classes

shashank hiwarkar1
Greenhorn

Joined: Feb 11, 2001
Posts: 25

Anonymous Inner classes cannot implement an interface and extend a non-final class at the same time.

can anyone explain me why?
(From Abhilash Exam)


shashank
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Because the syntax doesn't support it.
If you make an anonymous class you say
new InterfaceName(){ . . .};
or
new ClassName(){. . .};
in order to do BOTH you have to stuff 2 names in the new statement.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: anonymous classes