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 银行考研上岸祝福语简短