bla!=
should be followed by a condition, throws
should be throw
, Exception()
should be new Exception()
, exception
should be Exception e
try {
if (bla != null) // or anything else
throw new Exception("Exception thrown");
} catch (Exception e) {
System.out.println("Exception caught!");
e.printStackTrace();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…