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
Is singleton class immutable?
What is string builder in java?
What is an immutable object?
What is maximum size of arraylist in java?
What is volatile data type?
What is string in java is it a data type?
What is the difference between class & object?
Where is java located?
What are static variables and functions?
What does file separator do in java?
Will minecraft java be discontinued?
What is difference between pointer and reference?
What is garbage collection? What is the process that is responsible for doing that in java?
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
what do you understand by the term string with respect to java?