What will happen in the following code?
public class Geeks {
static void method() throws Exception {
throw new Exception("Error occurred");
}
public static void main(String[] args) {
method();
}
}
Compilation Error
Runtime Exception
Exception: Error occurred
Program runs successfully
This question is part of this quiz :
Java Exception Handling