java中的Integer包装类

Integer包装类转换为 基本数据类型的方式:

  1. int d = i.intValue(); (其中 I 是一个Integer包装类 ,不能是字符串)
  2. int d = Integer.parseInt(str); (其中的str可以是字符串类型,不过该字符串要正确描述该基本类型可以保存的值,这是一个静态方法)

猜你喜欢

转载自blog.csdn.net/syl2850246/article/details/82932470