2

What is the difference between final and other methods in java and when do we need final methods in our programmed?

1 Answers1

1

a final method can't be overridden by sub-classes.

You would use a final method when you allow other classes to extend your class (i.e. your class is not final itself), but you want to make sure your original implementation for some methods is still used by all the sub-classes.

Eran
  • 387,369
  • 54
  • 702
  • 768