method that intentionally throws an exception java code example
Example: java throws exception on method
static void testMethod() throws Exception {
String test = null;
test.toString();
}
static void testMethod() throws Exception {
String test = null;
test.toString();
}