What will happen if we cannot mention "finally" in Java
Program ???

Answers were Sorted based on User's Feedback



What will happen if we cannot mention "finally" in Java Program ???..

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

What will happen if we cannot mention "finally" in Java Program ???..

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

What will happen if we cannot mention "finally" in Java Program ???..

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

Post New Answer

More Core Java Interview Questions

Can an unreachable object become reachable again?

3 Answers  


What is use of map in java?

0 Answers  


How many objects are created when we create String class object using new operator?

9 Answers   Mind Tree,


How to store image in arraylist in java?

0 Answers  


What is lazy initialization in java?

0 Answers  






What are static methods?

0 Answers  


What are the java ide's? Explain

0 Answers  


How thread scheduler schedule the task?

0 Answers  


What is a classloader in java?

0 Answers  


What do you mean by the term transient?

5 Answers   Ericsson,


What are data types in oop?

0 Answers  


Explain public static void main(string args[]).

0 Answers  


Categories