常用類(包裝類)的的介紹

1.java中的常用類(包裝類)有

要注意首字母得大寫!


package Integer;

public class Interger {
	public static void main(String[] args) {
		Integer a = new Integer(1000);
		System.out.println(Integer.MAX_VALUE); //Integer.MAX_VALUE 常量,調用int最大值
		System.out.println(Integer.MIN_VALUE); //Integer.MIN_VALUE 同上 也是常量,調用int類型最小值
		//將一個對象裝換成一個字符
		Integer a1 = Integer.parseInt("123");
		System.out.println(a1 +1);
		
		//轉爲一個真正的字符串
		System.out.println(a1.intValue());
		
		//數字轉成字符串
		String str = 123 + "";
	}
	
	
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章