Why are these two different representations (dec vs. hex) of integers different in Java? -


say have 2 integers, 1 in decimal other in hexadecimal:

int myint01 = 0xc7d23020; int myint02 = 3352440864; 

the both same number, when try assign decimal integer variable in java, error:

error: integer number large: 3352440864 

but when assign hexadecimal integer variable in java, works should.

why way?

that's because 0xc7d23020 interpreted -942526432 valid int value, while 3352440864 wrong int value because it's higher limit 2147483647;


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -