Modifiers

There are a numberof modifiers you can use concurrently or by themselves in the definition of a method. These modifiers, such as final and static, provide various functions in terms of how they make your methods behave. Each has design and execution considerations and consequences, so they should all be used with care. For example, the final modifier makes your method non-overrideable. That's good for security, but it might not be desirable if you are shipping classes that you expect others to subclass, because they will not be able to change a final method's definition. Static methods are methods that can be used independently of an instance. They can be handy for running mathematical formulas, but in general they make your code less ...

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.