Find the Outputs of the given below code having nested try blocks :
public class Example16 {
public static void main(String[] args) {
for (int a = 0; a< 10; ++a) {
try {
try {
if (a % 3 == 0)
throw new Exception("Except1");
System.out.println(i);
} catch (Exception inside) {
a *= 2;
if (i % 3 == 0)
throw new Exception("Except2");
} finally {
++a;
}
} catch (Exception outside) {
a += 3;
} finally {
--a;
}
}
}
}
Find the Outputs of the given below code having nested try blocks :
1. 4 5
2. 4
3. 5
4 compile error
(1)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.