Java Double byteValue() MethodThe 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. SyntaxReturn valueThis method returns the double value represented by this object that has been converted to type byte. Example 1Test it NowOutput: Difference = 0.4399999999999995 Difference = 0.0 Example 2Test it NowOutput: Sum = 88.12 Sum = 88 Example 3Test it NowOutput: double value = 10.5 Converted byte value by type casting = 10 Example 4Test it NowOutput: Enter your digit 56.7 After rounding off the number becomes : 57
Next TopicJava Double
|