Online Java Compiler By
JavaTpoint.com
import java.lang.*; public class Float_floatValueMethodExample3 { public static void main(String[] args) { //passing negative float value float f1 = -98797987876875698796.63655768769857694f; Float f2 =new Float(f1); //either call floatValue() method this way Float f3 = f2.floatValue(); System.out.println("Float value = "+f3); //directly call the method in println function Float f4= new Float(-8276372f); System.out.println("Float value = "+f4); } }
Output