Byte有个方法
public int intValue() {
return (int)value;
}
Byte a = new Byte(1);
int b = a.intValue; //将Byte转为int
new Integer(1).byteValue() //将int转为byte
本文详细介绍了在Java中如何使用Byte类的intValue()方法将Byte类型的对象转换为int类型,以及如何通过Integer类的byteValue()方法将int类型转换回Byte类型。这种类型转换在处理不同数据类型间的数据交换时非常有用。
Byte有个方法
public int intValue() {
return (int)value;
}
Byte a = new Byte(1);
int b = a.intValue; //将Byte转为int
new Integer(1).byteValue() //将int转为byte

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