Home » Java Byte byteValue() Method

Java Byte byteValue() Method

by Online Tutorials Library

Java Byte byteValue() method

The byteValue() method of Java Byte class returns the value of this Byte as a byte.

Syntax:

Parameters:

NA

Overrides

The byteValue() method overrides byteValue in Number class.

Return Value

This method returns the numeric value of this object after converting it to primitive byte.

Example 1

Test it Now

Output:

34  

Example 2

Test it Now

Output:

-128  127  

Example 3

Test it Now

Output:

Error:(6, 21) java: byte cannot be dereferenced  

Next TopicJava Byte

You may also like