what are the differences between final,finally,finalize
methods?
Answer Posted / ravi
A "final" method or variable is one that can't be overridden
- you can define a method as final within a class to ensure
that any extensions to the class don't replace it.
If you add a "finally" block onto the end of a try / catch
exception handler, you're defining a block of code that will
be run if the try is entered, even if problems occur and
your method returns from within a catch rather than continuing.
A "finalize" method is your destructor method - code that's
run to clean up objects that are no longer required. For
example, objects which are memory cached would be flushed
back to the disc in your finalize.
Is This Answer Correct ? | 8 Yes | 7 No |
Post New Answer View All Answers
Which sorting algorithm is best in java?
Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
What is final keyword in java?
Mention some features of java?
What is a boolean structure?
Is assembly language a low level language?
Can set contain duplicates?
What is the use of set in java?
Can static methods access instance variables in java?
What is the difference between super class & sub class?
What is wrapper class example?
Is there any limitation of using inheritance?
why using interface interface ?
What is meant by object?
What is the name of the java compiler?