Find the Output of the following code :
public class Example15 {
public static void main(String[] args) {
for (int a = 0; a < 10; ++a) {
try {
if (a % 3 == 0)
throw new Exception("Except1");
try {
if (a % 3 == 1)
throw new Exception("Except2");
System.out.println(a);
} catch (Exception inside) {
a *= 2;
} finally {
++a;
}
} catch (Exception outside) {
a += 3;
} finally {
++a;
}
}
}
}
Find the Output of the above given code :
1. 5 8
2. 5
3. 8
4. compile error
5
8
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.