我在一个函数里调用了两个有异常的函数,为什么有的必须要处理,有的没有关系public static void test1()
{
int j = Integer.parseInt("p");
}
public static void test2()
{
 Class.forName("java.lang.String");

}
可是public static int parseInt(String s) throws NumberFormatException
和public static Class<?> forName(String className)throws ClassNotFoundException
两个都有异常,但test1编译能通过,test2编译通不过