[General boards] [Winter 2019 courses] [Fall 2018 courses] [Summer 2018 courses] [Older or newer terms]

Overloading public methods


Hi, are we allowed to overload the public methods, since I think I am not modifying the original public method’s signature?


Could you give an example? Did you mean overriding?

It’s fine to override public methods or inherit them from a parent class, as long as their signatures stay the same.


For example, there’s a public method update for FollowingFish, and I want to add overload this method, that I will create another public method update which has different argument types in FollowingFish, does this count as modifying the signature of public method?


No, as long as the originals are still callable, you can overload them I guess.