Monday, March 22, 2010

Java final keyword

http://en.wikipedia.org/wiki/Final_(Java)

Final Classes - cannot be subclassed
Final Methods - cannot be overridden in a subclass
Final Variables - cannot be reassigned

Bonuses:

finally - The finally block always executes when the try block exits

Object.finalize() method - Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected.

No comments: