Originally posted by Tim Holmes:
I am trying to figure out why this would be legal as a override:
void method(int i, float f){}
but this would not:
protected void method(int i, float f){}
wouldn't they be the same except the first one is "default access"?
Give the code which you are trying to run.
As far as i know , you cannot override a method by making the access level more restrictive.
If you are overiding a public method then the over riding method should also be public .
Anything besides that would be restrictive like private, protected or package level acess.
How ever if your method is private , you can over ride it using coderanch.
As it can be less restrictive but not more.
Hope this helps you .