java - Why cannot I assign value to a long variable that is between 2^64 and 2^32? -


i trying test difference between int , long data types , i've learned int has 32 bits whereas long has 64 bits. according this, long data type's maximum value 9,223,372,036,854,775,807. using 13-digit number getting error:

error: integer number large: 2147483645234

long exceedlong = 2147483645234;

i thought long variable should able handle value. i'm using jdk , jre version 8 , i'm compiling , running code in command prompt, using javac , java.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -