import java.awt.*;
/**
* Created by kodulf on 2017/4/5.
*/
public class BaozhuangLei {
public static void main(String[] args){
Byte b = (byte)1;
Short aShort = (short)1;
Integer i = 1;
Long l = 1l;
Boolean aBoolean = true;
Character c = '1';
Double d = 1.2;
Float f = 1.2f;
System.out.println(Long.MAX_VALUE);
System.out.println(Long.toString(100l));
System.out.println(Integer.parseInt("1"));
System.out.println(Double.parseDouble("1"));
//包装类,在Integer上面最大的作用就是进制的转换
//进制转换,数字转化为字符
System.out.println(Integer.toHexString(60));
System.out.println(Integer.toOctalString(60));
System.out.println(Integer.toBinaryString(60));
//字符转化为数字
System.out.println(Integer.parseInt("6c",16));
//自动装箱,下面的两个是相等的声明的,其实就相当于是java 帮我们把127给自动封装了一层了
Integer cc = 127;
Integer ccc = new Integer(127);
//一个数字如果在一个字节的范围内(-128~127),如果之前定义过了,那么就用之前定义的那个,这个是不是有毛病呢?没毛病,因为如果bb修改了,那么bb使用的是新的地址了
Integer aa = 127;
Integer bb = 127;
System.out.println(aa==bb);
Integer x = 128;
Integer y = 128;
System.out.println(x==y);
}
}
412



被折叠的 条评论
为什么被折叠?



