Integer b = Integer.valueOf("444",16); And int b = Integer.parseInt("444",16); Both returns 1092. Can anyone explain how? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
- 1

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

444 is string and 16 is radix which converts the string into integer.

7th May 2018, 9:29 PM
Syeda Zobia Kanwal
Syeda Zobia Kanwal - avatar
1 Réponse
0
4*256+4*16+4*1 1092 4*(16**2)+4*(16**1)+4*(16**0) It states that the given number is in hexadecimal format We have to convert it to decimal format
3rd Mar 2022, 10:31 AM
bucfiy