What will happen if we cannot mention "finally" in Java
Program ???
Answer Posted / dhruva
finally must be used while dealing with I/O like,
file,stream and reader, etc.
in finally block, we r closing I/O objects in LIFO way to
avoid curruption of I/O during GC process and also, after
one I/O related program finish execution - just for the
sake of flushing for next use in better way
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Which variable is the independent variable?
How do you check if a number is a perfect square?
What is local declaration?
What package is math in java?
What are the string methods in java?
What is another word for methodology?
What do you mean by hashing?
What is var keyword ?
In a class implementing an interface, can we change the value of any variable defined in the interface?
What is a memory leak in java?
Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?
Explain the difference between abstract classes and interfaces in java?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What is difference between overloading and overriding in java?
What's the access scope of protected access specifier?