数据类型之间的转换


//数据类型之间的转换需要用到包装类,如整数与字符串的转换
		
		//要将字符串转换基本的数据类型,用:Xxx包装类.parseXxx方式实现
		//一个例外是:Boolean类用的是:getBoolean方法;
		int w = Integer.parseInt(args[0]); 
		//要将包装包转成基本数据,用:Xxx包装类对象.xxxValue方式
		int h = new Integer(args[1]).intValue(); 
		int m = Integer.valueOf(args[1]).intValue(); 
		
		//java中8种基本数据类型 与相应的包装类对照:
		
		Boolean Boolean 
		Byte Byte
		Char Character
		short Short
		int Integer
		long Long
		float Float
		double Double


你可能感兴趣的:(Integer,byte)