This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Anonymous inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Anonymous inner class" Watch "Anonymous inner class" New topic
Author

Anonymous inner class

Faisal Ahmad
Ranch Hand

Joined: Aug 31, 2006
Posts: 346

Could you please tell me what's wrong with the following code? Im showing the source of 2 errors
Dustin Johnson
Greenhorn

Joined: Nov 14, 2006
Posts: 22
For one, it looks like you're trying to create two instances of variable named "p" as Popcorn types, your second one isn't an anonymous class from my discernment. It is clearly type Popcorn, and I'm not quite sure what the code block there is for me, as you are not creating an anonymous class just creating a new Popcorn() object...
[ March 08, 2007: Message edited by: Dustin Johnson ]

SCJA 86%<br />SCJP 5.0 98%<br />SCWCD 1.4 79%<br />SCBCD 5.0 83%<br />--------------------------------<br />"I drank what???" - Socrates
Faisal Ahmad
Ranch Hand

Joined: Aug 31, 2006
Posts: 346

I dont think my code is wrong where you've pointed it. Well, to make things more clear look into this code now:

Just removed ambiguity..still the same errors!
Faisal Ahmad
Ranch Hand

Joined: Aug 31, 2006
Posts: 346

I got it!
Well, while overriding a method, we've to maintain the signature and not pass the arguments. Arguments should be passed during the method call.
Herez the updated code:

Sorry for the stupidity!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anonymous inner class
 
Similar Threads
Anonymous Inner class
Inner classes
Anonymous inner class
K&B Anonymous Inner Class.
Instantiate an interface?