File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Java in General
Is it possible to create a constructor for anonymous inner class
Joined: Jan 08, 2008
Jan 18, 2008 02:13:00
Is it possible to create a constructor for anonymous inner class? If so, how?
***<br />K Vinod Reddy
Joined: Oct 15, 2007
Jan 18, 2008 02:49:00
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
Q: Anonymous inner class extending outer class
does an anonymous inner class have constructor?
Can JPanel's paint() use different Graphics2D objects?
Initializing instance variables in java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014