Java Integer byteValue() methodThe byteValue() is a method of byte class under java.lang package. It converts the given number into a primitive byte type and returns the value of integer object as byte. Also, it override the byteValue() method of Number class. SyntaxFollowing is the declaration of byteValue() method: Parameter:
Returns:The byteValue() method returns the numeric value represented by this object after conversion to the primitive byte type. Exceptions:NA Compatibility Version:Java 1.5 and above Example 1Output: Enter the Desired Numeric Value: 55 The Value of Byte is: 55 Example 2Test it NowOutput: 34 Example 3Test it NowOutput: The Byte object is: 80 Primitive byte value of Byte object is: 80 Example 4Test it NowOutput: b = -1 i2 = 255
Next TopicCompare() Method
|