java Api provided try catch finally ,try catch(its ok) but why try finally and exception occured at try then how the flow is?
Answer / vandana singh
If you want to do a task that must be perform with every situation when exception occurs or not. that you should write the code for this in finally block. cause finally block execute in both situation exception occurs or not.
if an exception occurs then catch block statements execute after that control transfer to finally block.
if any exception not occurs than control transfer to finally block.
| Is This Answer Correct ? | 26 Yes | 0 No |
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
What is the map interface in java programming?
Why pointers are not used in java?
What is the difference between member variables initialization and assignment in a constructor?
What does business logic mean?
What is tostring () method?
What is the difference between a checked and an unchecked exception?
Is singleton a bad practice?
What is the difference between getCodeBase and getDocumentBase methods?
1 Answers CS Business Services,
Is it safe for adding 10,00,000 records/objects to HashMap?, i.e is it safe to add millions of objects to HashMap?
Can you call a private data from an inner class?
Can a class be declared as protected?