Online Java Compiler By
JavaTpoint.com
public class Double_floatValueMethodExample1 { public static void main(String[] args) { Double double1 = 55.05587687687; Double double2= new Double(double1); //widening the float object float f1= double2.floatValue(); System.out.println(double1+ " after converted to float becomes : "+f1); } }
Output