Difference between final, finally and finalize method in Java

What is difference between final, finally and finalize method is asked to my friend in a Java interview with one of the US based Investment bank. Though it was just a telephonic round interview, he was asked couple of good questions e.g. how to avoid deadlock in Java, How get() method of HashMap works and one of the puzzle which is based on recursion. In short final keyword can be used along with variable, method and class and has different meaning for all of them. finally is another Java keyword which is used in Exception handling along with try, catch, throw and throws. finalize() is a special method in Java which is called by Garbage Collector before reclaiming GC eligible objects. In this Java interview questions article we will compare final vs finally vs finalize and highlight some important difference between final, finally and finalize method in Java.
Read more »

0 Response to "Difference between final, finally and finalize method in Java"

Posting Komentar