kk-dev11
kk-dev11

Reputation: 2674

What does X do in Integer.parseInt(..,X)?

I'm trying to get Characters from decimal and hex value.

I tried this code.

(char) Integer.parseInt("AE",16)

It displayed a hexadecimal character, namely (R).

Then I tried

(char) Integer.parseInt("65283",32)

That displayed a east asian character, perhaps Chinese.

Can Anyone please explain me, what these numbers (16,32) stand for?

Thanks in advance.

Upvotes: 1

Views: 802

Answers (1)

kosa
kosa

Reputation: 66637

Integer.parseInt("AE",16)

16, 32 represent radix

Parses the string argument as a signed integer in the radix specified by the second argument

and

The characters in the string must all be digits of the specified radix

Upvotes: 3

Related Questions