aspose file tools*
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
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: 355

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: 355

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: 355

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!
 
 
subject: Anonymous inner class