Answers for "java.math.biginteger cannot be cast to java.lang.long"

1

java.math.biginteger cannot be cast to java.lang.long

// BigInteger can be bigger than Long. If so, then the ".longValue()" will return an exception.
    public static void main(String[] args) { // Program start method.
        BigInteger bigInteger = new BigInteger(Long.MAX_VALUE + ""); // Create the BigInteger.
        System.out.println("LongValue: " + bigInteger.longValue()); // Get the value in Long form.
    }
Posted by: Guest on November-22-2021

Code answers related to "java.math.biginteger cannot be cast to java.lang.long"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language