• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can anonymous class extend any other class?

 
Hemal Mehta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can anonymous class extend any other class? Can it be done explicitly?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code shows how to go about making an anonymous class extend any other class.

The output is
anonymous extension of A
A
[ February 07, 2003: Message edited by: Valentin Crettaz ]
 
Igor Zeta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do it explicitly using the extends keyword
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is strictly prohibited to use the "extends" and "implements" keywords in an anonymous class declaration.
[ February 07, 2003: Message edited by: Valentin Crettaz ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic