Home » Java Byte floatValue() Method

Java Byte floatValue() Method

by Online Tutorials Library

Java Byte floatValue() method

The floatValue() method of Java Byte class returns a float value for this Byte after a widening primitive conversion.

Syntax:

Parameters:

NA

Specified by

This method is specified by floatValue in class Number

Return Value

This method returns the numeric value of this object after conversion to type float.

Example 1

Test it Now

Output:

Float value : 98.0  Float value : 102.0  

Example 2

Test it Now

Output:

-128.0  127.0  

Example 3

Test it Now

Output:

Error:(8, 39) java: byte cannot be dereferenced  

Next TopicJava Byte

You may also like