Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
by (6.5k points)
I understand what a final method is but what are the uses of declaring one as final?

1 Answer

0 votes
by (11.3k points)

There are primarily two reasons for making a method final:

  • Subclasses are restricted from changing the meaning or functionality of the method. (Overriding)
  • It also helps in increasing the efficiency of the code by providing the compiler the means to convert the calls to the method into inline java code. 
Taking a good java course in a well-structured manner should clarify a lot of doubts you may have on a fundamental level. 

Browse Categories