What will happen if we cannot mention "finally" in Java
Program ???
Answers were Sorted based on User's Feedback
Answer / ashok
no problem.if we declare it is better.because compulsory
statements are written in finally block.
| Is This Answer Correct ? | 18 Yes | 0 No |
Answer / 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 |
Answer / busi
Nothing happend , if any information should be displayed on
console we can use this finally block.Irrespective of code
execution the jvm will display the message on console.
| Is This Answer Correct ? | 1 Yes | 3 No |
Can we inherit the constructor in a Class?please give one example.
What is the difference between a field variable and a local variable?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?
why not override thread to make a runnable? : Java thread
What is a method signature java?
What is the maximum size of hashmap in java?
Why destructor is not used in java?
What do you mean by default constructor in java?
What is the epoch date?
How to perform linear search in java?
what is the Yield() method used in threads?
What is java util collection?