Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What's the access scope of protected access specifier?

1017


When do you get classcastexception?

1013


What is thread life cycle?

940


Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example

2591


Where and how can you use a private constructor?

971


Is singleton set an interval?

940


Can we have 2 main methods in java class?

1005


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

1119


Is java programming easy?

973


Is null == null in java?

1086


What is the difference between procedural and object-oriented programs?

955


Can we overload the main() method?

1032


Explain the purpose of garbage collection in Java?

1007


What modifiers are allowed for methods in an interface?

1137


Explain the difference between treeset and treemap in java?

956