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

Overloading public methods


#1

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


#2

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.


#3

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?


#4

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