# Integer.parsInt() method and allowed values of radix..

posted 7 years ago

output: 411787

I could not understand the output. i.e.

1.How to decide the range of radix.( in between Character.MIN_RADIX and Character.MAX_RADIX. given in api)

2.How can we decide what would be printed, if we take a radix 19 or 24.

3.what cab be allowed values for String argument if we take a radix, say 34.

- 0

public static int parseInt(String s,

int radix)

throws NumberFormatException

output: 411787

I could not understand the output. i.e.

1.How to decide the range of radix.( in between Character.MIN_RADIX and Character.MAX_RADIX. given in api)

2.How can we decide what would be printed, if we take a radix 19 or 24.

3.what cab be allowed values for String argument if we take a radix, say 34.

Punit Singh

Ranch Hand

Posts: 952

posted 7 years ago

- 0

If you set the radix to the max i.e. 36, then the resulting Number system would have this sequence of digits (you can say it as the primary parts of a number system or something like 0-9 in decimal system are the basic parts which can be combined to form say one hundred and fifty as 150)

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

And suppose you take radix as 27, then the allowed values will be

0123456789ABCDEFGHIJKLMNOPQ

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

And suppose you take radix as 27, then the allowed values will be

0123456789ABCDEFGHIJKLMNOPQ

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links

Punit Singh

Ranch Hand

Posts: 952

posted 7 years ago

Ohhhhh my god, It will surely out of course, this is not SCJP question, this is Mathematics question. If they want to ask such question than there should be another exam like SCJP Maths-310-M65.

- 0

Ohhhhh my god, It will surely out of course, this is not SCJP question, this is Mathematics question. If they want to ask such question than there should be another exam like SCJP Maths-310-M65.

SCJP 6

Punit Singh

Ranch Hand

Posts: 952

posted 7 years ago

thanks for clearing my doubts too!!! i got the key of this matter

- 0

Ankit Garg wrote:If you set the radix to the max i.e. 36, then the resulting Number system would have this sequence of digits (you can say it as the primary parts of a number system or something like 0-9 in decimal system are the basic parts which can be combined to form say one hundred and fifty as 150)

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

And suppose you take radix as 27, then the allowed values will be

0123456789ABCDEFGHIJKLMNOPQ

thanks for clearing my doubts too!!! i got the key of this matter

Dhruva

Ruben Soto

Ranch Hand

Posts: 1032

I agree. Here's the link: http://aspose.com/file-tools |