用竖线运算符捕获多个异常对于每个例外
//来自 nowjava.com - 时代Java import java.io.FileInputStream; import java.io.IOException; public class Main { public static void main(String[] args) { try { Class<?> stringClass = Class.forName("java.lang.String"); FileInputStream in = new FileInputStream("myFile.log"); // Can throw // IOException in.read(); } catch (IOException | ClassNotFoundException e) {