【Java开源代码栏目提醒】:网学会员为广大网友收集整理了,ByteClass.java,希望对大家有所帮助!
public class ByteClass
{
public static void main(String[] args)
{
Byte x='a';
Byte y='A';
System.out.println(x.toString());
//hashCode() 返回Byte对象的哈希码
System.out.println(x.hashCode());
System.out.println(y.intValue());
System.out.println(x.longValue());
System.out.println(y.byteValue());
//比较两个Byte对象
System.out.println(x.compareTo(y));
//MAX_VALUE,MIN_VALUE 表示Byte类型能表示的最大/最小值
System.out.println(x.MIN_VALUE);
System.out.println(x.MAX_VALUE);
System.out.println(y.compare(x, y));
//SIZE 表示二进制补码表示的Byte值的比特位数
System.out.println(x.SIZE);
}
}
上一篇:
ByteBufferOutputStream.java
下一篇:
超市进销存管理系统的开发