Java Objects |
You can use thefinal
keyword in a method declaration to indicate to the compiler that the method cannot be overridden by subclasses.You will want to make some methods final to prevent subclasses from overriding that method particularly if the method has an implementation that cannot and should not be changed and is critical to the consistent state of the object. For example,
Table of Contents |