I am trying to test the difference between int and long data types and I've learned that int has 32 bits whereas long has 64 bits. According to this, long data type's maximum value is 9,223,372,036,854,775,807. I am only using a 13-digit number however I am getting this error:
error: integer number too large: 2147483645234
long exceedLong = 2147483645234;
I thought a long variable should be able to handle that value. I'm using JDK and JRE version 8 and I'm compiling and running the code in command prompt, using javac and java.