News for hackers. Stuff that matters.
Re:If Inheritance is so bad, why does everyone use it? by kaba0 on Saturday April 13, 2024 @05:33AM (#40021765)
If you pass your object to another function, you only get static dispatch. What you want instead in this case, is a simple instance method. Then yourApple.rotateFruit() would do what you want, and rutateFruit could be an interface method declared in Apple, the superclass/interface.

There are no comments on this comment yet.