public class ThrowExceptionExample { private void m1() { try { m2(); } catch(Exception e) { System.out.println( I catch it! ); } private void m2() throws Exception { //I just want to throw an exception throw new Exception(); } public static void main(String[] args) { new ThrowExceptionExample().m1(); }
{}