Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerFloatValueExample { public static void main(String[] args){ // create 2 BigIntegerobjects BigInteger big1,big2; // create 2 Floatobjects Float f1,f2; // assign values to big1,big2 big1= new BigInteger( "123" ); big2= new BigInteger( "-123" ); // assign float value of big1,big2 to f1 ,f2 f1= big1.floatValue(); f2= big2.floatValue(); String str1= "Result of floatValueoperation on " +big1+" is " + f1; String str2= "Result of floatValueoperation on " +big2+" is " + f2; // print f1,f2 values System.out.println(str1); System.out.println(str2); } }
Output