- 1

Integer b = Integer.valueOf("444",16); And int b = Integer.parseInt("444",16); Both returns 1092. Can anyone explain how?

"444" is string & 16 is radix, which converts string into integer

7th May 2018, 6:50 PM
Syeda Zobia Kanwal
Syeda Zobia Kanwal - avatar
2 odpowiedzi
+ 4
0x444 is hexadecimal (base 16) representation of decimal 1092, since you specify the radix (base) to be 16, that is what you get from the conversion ->1092. Hope it makes sense : ) https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html
10th May 2018, 7:40 PM
Ipang
+ 1
got it. thanks!
10th May 2018, 8:51 PM
Syeda Zobia Kanwal
Syeda Zobia Kanwal - avatar