java throws error code example
Example 1: java throws exception on method
static void testMethod() throws Exception {
String test = null;
test.toString();
}
Example 2: throw error java
throw new java.lang.Error("this is very bad");
throw new java.lang.RuntimeException("this is not quite as bad");