Monday, July 5, 2010

The “final” Keyword

The keyword final has three uses.
• Create the equivalent of a named constant.
• Prevent Overriding - Methods declared as final cannot be overridden.
• Prevent Inheritance - Classes declared as final cannot be inherited.

It is illegal to declare a class as both abstract and final

No comments:

Post a Comment