Guess the output?
public class Main {
public static void solve() {
int first = 10, second = 20;
int third = first + second;
{
int third = second - first;
System.out.printf("%d ", third);
}
System.out.printf("%d", third);
throw new RuntimeException("Something went wrong!");
}
public static void main(String[] args) {
try {
solve();
} catch (Exception e) {
System.err.println("Exception occurred: " + e.getMessage());
}
}
}



Posted on by