Write a program to handle an exception using try, catch and throw.
public class Main {
public static void main(String[] args) {
try {
throw new Exception("Some exception.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Comments
Leave a comment