public class ThrowException {
public static void main(String[] args) {
throw new IllegalArgumentException("Bad Argument");
}
}
Output:
$ java ThrowException
Exception in thread "main" java.lang.IllegalArgumentException: Bad Argument
at ThrowException.main(ThrowException.java:3)