-
编译错误
String s=new String(null);
-
空指针异常:NullPointerException
String s=null; if(1==0){ s="123"; } String s1=new String(s);
-
抛出数值转换异常:NumberFormatException
Integer i=new Integer("zh"); Integer i=new Integer(null);
-
测试初始化小数是否需要加f/d
Float f=new Float("1"); Double d=new Double("1");
Integer、String、Float、Double传入参数非法抛出的异常
最新推荐文章于 2022-07-03 17:15:23 发布