This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Is it possible to create a constructor for anonymous inner class
 
jQuery in Action, 3rd edition