Java Double byteValue() Method

The byteValue() method of Java Double class returns the value of this double as a byte after a narrowing primitive conversion.

The byteValue () method of class Double overrides the byteValue () method of class Number.

Syntax

Return value

This method returns the double value represented by this object that has been converted to type byte.

Example 1

Output:

Difference = 0.4399999999999995
Difference = 0.0

Example 2

Output:

Sum = 88.12
Sum = 88

Example 3

Output:

double value = 10.5
Converted byte value by type casting = 10

Example 4

Output:

Enter your digit
56.7
After rounding off the number becomes : 57