Win a copy of Rust Web Development this week in the Other Languages forum!

rkapoor

Greenhorn
+ Follow
since Aug 05, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rkapoor

sub class scope will inherit the method amethod(int i){} from the super class Base (You can override it if you want but it is not required) Therefore Scope will always have amethod(int i) as its member. Now Scope can further have its own methods with same name but different input argument(s). Answer 2 and 3 will cause overloading of amethod in Scope class. There is no rule that you can not have new methods of same name in the subclass with different argument(s). Again you are doing overloading in Scope which just happened to be a sub class of Base.Now Base calss has nothing to do with this overloading. These methods only belong to Scope class.Hope I have cleared your point.
[This message has been edited by rkapoor (edited August 07, 2000).]
In the main class int f() is a private method while in subclass int f() is a public method, with overall visibility of sub class, its visibility is more than what it is in the main class. Therefore it should compile and run. Why are you saying that its visibility is reduced?