File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a question of anonymous class

 
Stephen Lee
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem....
is this sentence true or false?
An anonymous class can only be created within the body of a method. thx!
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can also create an anonymous class inside an (static or non-static) initializer block and in member initialization also.

HIH

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic