Java BigInteger valueOf() methodThe valueOf() method of Java BigInteger class returns a BigInteger whose value is equal to that of the specified long. Syntax:Parameter:val - value of the BigInteger to return. Returns:This method returns a BigInteger with the specified value. Exception:NA Note: This static factory method is provided in preference to a (long) constructor because it allows for reuse of regularly used BigIntegers.Example 1Test it NowOutput: BigIntger value of Long 123456789 is 123456789 Example 2Test it NowOutput: BigIntger value of Long 25 is 25 Example 3Test it NowOutput: BigIntger value of Long 12345 is 12345 Next TopicJava BigInteger |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India