类型 |
占用存储空间 |
表数范围 |
Byte |
1字节 |
-128~127 |
Short |
2字节 |
-215 ~ 215-1 (-32768~32767) |
Int |
4字节 |
-231 ~ 231-1 (-2147483648~2147483647) 约21亿 |
Long |
8字节 |
-263 ~ 263-1 |
System.out.println(Integer.toBinaryString(a)); //整型转二进制
System.out.println(Integer.toOctalString(a)); //整型转十进制
System.out.println(Integer.toHexString(a)); //整型转十六进制
原文:http://www.cnblogs.com/yangxuming/p/6926007.html