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
Post a Comment