Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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.
    }
 
PREVIOUS NEXT
Tagged: #cast
ADD COMMENT
Topic
Name
2+6 =