permaculture playing cards*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Is this overriding? 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 "Is this overriding?" Watch "Is this overriding?" New topic
Author

Is this overriding?

Rahul Bhosale
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
Please go through the following code.


1. Is that another example of method overriding?
2. Can anybody change the code so that the class Inner than extends InnerClassEx2 is non static but still be able to be instantiated in the main method with an anonymous class? (i'm getting a compilation error when trying to do so..
thanks


RB
Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
1) yeah its an example of overriding

2)


Just try out the way its done above. I hope thats what u wanted
Rahul Bhosale
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
I did try that Animesh,
but i get a compiler error.. well i think its a compilation error cuz i'm using eclipse 3.0.1

Error message:
No enclosing instance of type InnerClassEx2 is available due to some intermediate constructor invocationInnerClassEx2.javaline 19
Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
yeah even i was wondering, I am using jdk 1.3 , thats the reason
Dont use eclipse in that case, use ur javac command to compile the class, it does i guess

This is also discusses here
anonymous class
Rahul Bhosale
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
Thanks animesh for your swift responses.. i wish they had duke dollars here too i could have spared some for you .. this is all i can say and its too late in the night for me.. catch up with your posts in the morning.
M Rama
Ranch Hand

Joined: Mar 04, 2005
Posts: 91
Hi Animesh,
I tried to compile your code from command line and am getting the same error message. Is this the right syntax??
Rahul Bhosale
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
nope,
i think it should be

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this overriding?