Long 陷阱

String str = "10";
System.out.print(Long.getLong(str));

System.out.print(Long.valueOf(str));

这两个不一样的! 

java.lang.Long.getLong(String nm) 方法确定具有指定名称的系统属性的long值。如果没有具有指定名称的属性,如果指定名称为空或null,或者该属性没有正确的数字格式,则返回null。

原文地址:https://www.cnblogs.com/huhuuu/p/5674993.html