Is it necessary that each try block must be followed by a catch block?
Answer / Abhishek Srivastav
No, it's not mandatory. A try block can be followed by either one or more catch blocks or a finally block (or both). If there are no catch blocks for a particular exception thrown in the try block, it will propagate up to the caller until it is handled.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is parameter example?
Explain java coding standards for interfaces?
Why generics are used in java?
What is the difference between form & report?
What are the OOAD concepts in java explain with examples?
What is the definition of tree ?
ublic class Java_Coding_Samples { public static void JavaHungr(NumberFormatException ae){ System.out.println("integer"); } public static void JavaHungry(Exception e){ System.out.println("string"); } public static void JavaHungry(ArithmeticException ae){ System.out.println("object"); } public static void main(String[] args) { JavaHungry(null); }
What does the “static” keyword mean? Can you override private or static method in java?
Explain access specifiers?
1 Answers Thomson Reuters, Virtusa,
What is difference between identifier and variable?
How does thread synchronization occurs inside a monitor?
What are the 5 types of research methods?