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
What is string literal in java?
What is meant by interface?
How do you calculate square roots?
How do you start a thread?
Explain the difference between serializable and externalizable in java?
Are static members inherited to sub classes?
Why put method is idempotent?
What is the same as procedures?
What are heap memory and stack memory and what are memory tables.
What is annotation in java?
What is meant by overloading?
How do you sort arraylist in descending order?
What is the lifetime and scope of a variable?
Can we override private method?
What are loops in java?