Java Integer byteValue()方法
该byteValue()方法以字节的形式返回此Integer的值。
以下是byteValue()在Java中实现该方法的示例-
示例
public class Main {
public static void main(String[] args) {
Integer val = new Integer(10);
byte res = val.byteValue();
System.out.println("Value = " + res);
}
}输出结果
Value = 10
让我们看另一个例子-
示例
import java.util.*;
public class Main {
public static void main(String[] args) {
Byte b = new Byte("10");
byte res = b.byteValue();
System.out.println("Byte = " + b );
System.out.println("Primitive byte = "+ res);
}
}输出结果
Byte = 80 Primitive byte = 80
热门推荐
10 媒人婚礼祝福语简短大气
11 中考考后祝福语简短
12 妈妈病人出院祝福语简短
13 古风祝福语 唯美简短结婚
14 校庆祝福语简短横幅
15 爸爸生日的祝福语简短
16 财神祝福语简短网名
17 生日祝福语 简短独特潮
18 虎年贺卡和祝福语简短