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
Why synchronization is important in java?
Why volatile is used in java?
What is the difference between path and classpath variables?
Why does abstract class have constructor?
What is garbage collection? What is the process that is responsible for doing that in java?
Do I need to import java.lang package any time? Why?
Does anyone still use java?
What is meant by object oriented programming – oop?
What are the four versions of java?
How do you sort objects in java?
What is difference between this and super keyword?
What do you understand by final value?
Can a static class have a constructor?
List any five features of java?
What is native method in java?