Final Methods


Final Methods

Final methods, like final classes and variables , cannot be overridden. A final method is designated as such by using the final keyword in the method declaration. Final methods are used to protect certain functionality from being altered by subclasses. An example of a final method is the wait() method from the Thread class. This method notifies a thread in a waiting state that the condition it is waiting for has been met. You don't want people messing around with threading functionality, so this method is declared final .



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net