Java Integer byteValue()方法

这个 字节值() java的整数类的方法。lang包在缩小原语转换后将给定的整数转换为字节,并返回它。

null

语法:

public byte byteValue()

Return :
This method returns the numeric value represented by this object after
 conversion to byte type.

例子: 表示工作 JAVA整型。字节值() 方法

// Java program to demonstrate working
// of java.lang.Integer.byteValue() method
import java.lang.Integer;
class Gfg {
// driver code
public static void main(String args[])
{
Integer a = new Integer( 34 );
// Convert Integer number to byte value
byte b = a.byteValue();
System.out.println(b);
}
}


输出:

34
© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享