Java - Exception Handling
Identify the error in the following code snippet:
public class Example {
public static void main(String[] args) {
throw new Exception("Problem");
}
}Identify the error in the following code snippet:
public class Example {
public static void main(String[] args) {
throw new Exception("Problem");
}
}Exception, which is a checked exception in Java.throws in the method signature. This code does neither, causing a compile error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions