inheritance - Why java doesn't allow final class to be inherited? -
this question has answer here:
- good reasons prohibit inheritance in java? 11 answers
as know, can't inherit final class in java want know why java doesn't allow so? reason behind it?
final
means "do not inherit me" (in context, has other meaning in different contexts).
the reason developers mark class final optimizations. either can guarantee variables of class , jit can take advantage of can avoid more expensive virtual calls , rather inline methods directly.
Comments
Post a Comment