Online Java Compiler By
JavaTpoint.com
import java.math.BigInteger; public class BigIntegerValueOfExample1 { public static void main(String[] args) { // create a BigInteger object BigInteger big1; // create and assign value to Long object Long long1 = new Long(123456789L); // assign the biginteger value of long1 to big1 // static method is called using class name big1 = BigInteger.valueOf(long1); String str = "BigIntger value of Long "+long1+" is "+big1; // print big1 value System.out.println(str); } }
Output