Try block not followed
What happens when a try block is neither followed by a try block nor a finally block?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jeetendra GundRank #97 · 22.1K reputationPosted Nov 11, 2013, 10:52 PM EST
Tell me your exact question or problem regarding try block.
Thanks,
Jeetendra
VulpesRank #55 · 29.2K reputationPosted Nov 12, 2013, 12:40 AM EST
1. One or more catch blocks; or
2. A finally block.
In the case of #1, the catch block(s) may be optionally followed by a finally block.
Consequently, a try block must be followed by either a catch or finally block and, if you fail to do that, the compiler will issue an error message.
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 12, 2013, 1:41 AM EST
hi,
If you use Try block without catch and finally block it it compile time error.
so It is not possible try block without catch or finally block.