Loading

Java之类型的转换

1.String 类型转化为 int 类型,需要使用 Integer 类中的 parseInt() 方法或者 valueOf() 方法进行转换.

int a = Integer.parseInt(str);

int b = Integer.valueOf(str).intValue()

 

posted @ 2016-04-17 22:03  头痛不头痛  阅读(174)  评论(0编辑  收藏  举报