- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between final, finally and finalize() in Java?
85 Lectures 6 hours
The final keyword can be used with class method and variable. A final class cannot be instantiated, a final method cannot be overridden and a final variable cannot be reassigned.
The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred. Using a finally block allows you to run any cleanup-type statements that you just wish to execute, despite what happens within the protected code.
The finalize() method is used just before object is destroyed and can be called just prior to object creation.
- Difference Between Final, Finally and Finalize in Java
- final, finally and finalize in Java
- final, finally and finalize in C#
- What is the difference between Finalize and Dispose in C#?
- Difference Between dispose() and finalize() in C#
- Difference Between Static and Final in Java
- Difference between constants and final variables in Java?
- What is the finally block in Java?
- What is the difference between Java and Core Java?
- What is the difference between Java and Java EE
- What is the difference between /* */ and /** */ comments in Java?
- What is the difference between compositions and aggregations in Java?
- What is the difference between abstraction and encapsulation in Java?
- What is the difference between transient and volatile in Java?