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


Please Help Members By Posting Answers For Below Questions

Do loops java?

637


What is the difference in between cpp and java? Can u explain in detail?

697


How will you invoke any external process in java?

692


What are byte codes?

750


Why does java not support operator overloading?

766






What is remote method invocation (rmi)?

693


What is dot operator?

662


What is difference between public static and void?

569


What does %4d mean in java?

1014


What is the purpose class.forname method?

648


What is the primary benefit of encapsulation?

654


What is the basic difference between string and stringbuffer object?

680


Why java is called not pure object oriented language?

682


Is heap stored in ram?

629


What is lifetime variable?

605