inheritance - Why java doesn't allow final class to be inherited? -


this question has answer here:

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

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -