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

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -