4 ms·
It's not a performance optimisation, it's to avoid codebases accidentally becoming a big ball of mud. Prefer composition over inheritance. Definitely do not inh
by garethrowlands 5y ago
It's not a performance optimisation, it's to avoid codebases accidentally becoming a big ball of mud. Prefer composition over inheritance. Definitely do not inherit accidentally or from a class that wasn't designed for inheritance.
The JVM can already optimise classes with no subclasses because it knows all the classes that are currently loaded, so it doesn't need language support.