I was looking through the OpenJDK source code, and saw that a method is classed as final if the method is final or it's holder (class) is final. Does that means that there is 100% no purpose to making a method final in a final class, maybe apart from making an ultra-micro optimisation where the 2nd check for a final class isn't ran? (the OpenJDK code is return is_final() || holder()->is_final();)
#Does a final method serve any purpose in a final class?
3 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @ripe temple! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.