Re:It’s time to move on from OOP?
by timw4mail on Monday July 22, 2019 @09:24AM
(#20497741)
What? Every language I've used you can easily override a parent method with a method in the child class.
[ Parent
| on HN ]
Re:It’s time to move on from OOP?
by protomolecule on Monday July 22, 2019 @01:27PM
(#20500227)
I haven't thought of Java. As the sibling comment says, it's the case for C++ and C#.
In case of Java I agree with ernst_klim's critique, to me it's a poor language design choice. Dynamic languages are a mess anyway, but that's just my opinion :)
Java went with Smalltalk/Objective-C/Modula-3 defaults, because it was heavily inspired by them in language sematics.
However you can still terminate a virtual chain, or not offer it at all with the final modifier.
Not in C++ unless a method is explicitly marked as virtual. IIRC C# behaves in the same way. In Java, D, all methods are virtual by default. Most dynamic languages also behave in the same way (due to pervasive late binding).