aspose file tools*
The moose likes Java in General and the fly likes Is it possible to create a constructor for anonymous inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Is it possible to create a constructor for anonymous inner class" Watch "Is it possible to create a constructor for anonymous inner class" New topic
Author

Is it possible to create a constructor for anonymous inner class

vinodreddy kisanagaram
Greenhorn

Joined: Jan 08, 2008
Posts: 9
Is it possible to create a constructor for anonymous inner class? If so, how?


***<br />K Vinod Reddy
Kishore Kumar
Ranch Hand

Joined: Oct 15, 2007
Posts: 71
No, you cannot have a constructor in an anonymus class, because you don't have the name of the class. Instead you can add an instance initialization block which acts like a constructor.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is it possible to create a constructor for anonymous inner class