A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Elasticsearch in Action
this week in the
Programmer Certification (SCJP/OCPJP)
About anonymous inner class!
Joined: Nov 19, 2001
Dec 10, 2001 00:08:00
Could a anonymous inner class have its own constructor ? if yes, could someone give me a sample about this, Some books say Yes,others say No. i am really really confused ...
Thanx in advance
Tony Sam<BR>One want to be a SCJP...
Joined: Nov 22, 2001
Dec 10, 2001 01:19:00
no const in annonemus class
Muhammad Hussain<br />Sun Certified Java Programer (SCJP2)<br />Sun Certified Web Component Devloper SCWCD
Joined: Sep 16, 2001
Dec 10, 2001 08:17:00
Just think why it is called "anonymous"?
It has no name and a constructor must have the same name as
its class. So, it is impossible to have a constructor for an anonymous class.
Joined: Jun 14, 2001
Dec 10, 2001 13:56:00
You cannot have constructor for anonymous inner class but if the parent class have constructors,then we can arrange to invoke one of the parent class constructors by passing the appropriate arguments...
It is sorta covered in the
JavaRanch Style Guide
subject: About anonymous inner class!
Abstract Class Within an Interface
How many object is eligible for garbage collection?
A question about creating an anonymous inner class
Difference between inner and nested classes ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015