Given below the sample code :
class Main {
static String a = "&&";
public static void main(String[] args) {
new Main().a1();
System.out.println(a);
}
void a1() {
try {
a2();
} catch (Exception e) {
a += "x";
}
}
void a2() throws Exception {
a3();
a += "7";
a3();
a += "7x";
}
void a3() throws Exception {
throw new Exception();
}
}
What will be the output of the following code ?
1.Compilation error
2.&&7
3.&&7x
4.-x
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.