![]() |
VOOZH | about |
The byteValue() method of Integer class of java.lang package converts the given Integer into a byte after a narrowing primitive conversion and returns it (value of integer object as a byte). Also, remember this method does override byteValue() method of the Number class.
The package view is as follows:
--> java.lang Package --> Integer Class --> byteValue() Method
Syntax :
public byte byteValue()
Return Type: Returns the numeric value represented by this object after conversion to byte type.
Note: It is compatible with Java 1.5 and onwards.
Example 1:
34
Example 2:
Byte object : 1 Primitive byte value of Byte object : 1