|
|
|
|
|
by Majora320
2919 days ago
|
|
I'm not the original commenter (and on mobile, so this response might be a little terse), but I think what he's talking about is polymorpism. For an example, if you have two classes, Int and String, and you have a method special_fn you want to implement for both in different ways, (e.g. "addition/concatanation"), you can either make a bunch of special_fn_* stuff, or simply create an interface SpecialFner with the special_fn method, and implement it for Int and Str. This lets you use this interface in other places without worrying about all the different versions of this function. |
|