posted 13 years ago
If I wasn't nervous, I'd put the subject line as "super doubt". Nevertheless..
Consider these two classes:
And the second class:
This is from the learnkey exam. It says that the compilation will fail because of #1 and that "Only instance methods can be overridden, and calls to super only apply to overridden methods". I understand (and please correct me if I am wrong) that getRating2 is a static method so overriding it is out of question, but here is my doubt: what is the point of using super to access getRating()? Is it just to confuse?
thanks,
aditya kumar