Java數據類型轉換

1)將字符串轉化爲整型; int i = Integer.parseInt(String str); int i = Integer.valueOf(String str).intValue(); 注:Integer.parseInt和 Integer.valueOf 不同,前者生成的是整型,而後者是一個對象,所以要通過intValue()來獲得對象的值; 2) 整型轉化爲字符串: String
相關文章
相關標籤/搜索