| Author |
Anonymous Inner Class
|
Sen George
Ranch Hand
Joined: Sep 21, 2005
Posts: 76
|
|
In the following code listing, please explain why the output " prAnon procedure" is not generated.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26218
|
|
Sen, Where does prAnon get called? It's just a method. If it doesn't get called, it doesn't print anything.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Bert Bates
author
Sheriff
Joined: Oct 14, 2002
Posts: 8712
|
|
|
moved to the intermediate forum
|
Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
Just a guess on what might be causing the misunderstanding... In the syntax for an anonymous inner class, the constructor call is followed by the anonymous class definition -- not the body of the constructor. So the code within the braces does not execute with "new."
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
Sen George
Ranch Hand
Joined: Sep 21, 2005
Posts: 76
|
|
|
How can I incorporate a call to invoke the method defined in an anonymous class?
|
 |
 |
|
|
subject: Anonymous Inner Class
|
|
|