Sunday, 17 April 2011

What are the uses of final method?

There are two reasons for marking a method as final:
  • Disallowing subclasses to change the meaning of the method.
  • Increasing efficiency by allowing the compiler to turn calls to the method into inline Java code.

No comments:

Post a Comment