christainpaul
Freshie
- Messages
- 4
- Joined
- Mar 4, 2010
- Messages
- 4
- Reaction score
- 0
- Points
- 3
final is used for making a class no-subclassable, and making a member variable as a constant which cannot be modified.finally is usually used to release all the resources utilized inside the try block. All the resources present in the finalize method will be garbage collected whenever GC is called. Though finally and finalize seem to be or a similar task there is an interesting difference here.This is because the code in finally block is guaranteed of execution irrespective of occurrence of exception, while execution of finalize is not guarenteed.finalize metod is called by the garbage collector on an object when the garbage collector determines that there are no more references to the object.