72
Java Short byteValue() Method
The byteValue() method of Java Short class is a wrapper class.
Syntax
Parameters
N/A
Return value
Returns the value of this Short class as a byte after a narrowing primitive conversion. If we override byteValue in Number class then it will return Numeric Value represented by this object after conversion to byte type.
Example 1
Output:
Byte b = 45
Example 2
Output:
byte b value = -125
Example 3
Output:
byte Value of b = 68
Example 4
Output:
byte Value of b = -119
Example 5
Output:
55
Next TopicJava Short