Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (6.5k points)
recategorized by
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. 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...