常用类(包装类)的的介绍

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 + "";
	}
	
	
}


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