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 2Output: 34 Example 3Output: The Byte object is: 80 Primitive byte value of Byte object is: 80 Example 4Output: b = -1 i2 = 255 Next TopicJava-integer-compare-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India