Java source code examples

Java source code samples. Java code examples.

Convert an byte value to float value

          0 votes

The floatValue method of Byte class is used for converting a byte value to primitive float value.

public class ByteWrapper {
	public static void main(String[] args) {
		byte byteValue = 10;
		Byte objByte = new Byte(byteValue);
		float value = objByte.floatValue();
		System.out.println(value);
	}
}

Tags: java.lang

Discuss This Code