Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert multiple string types into integer types in JAVA?
How to convert multiple string types into integer types in JAVA?
string str = ' 1 1 1 ';

int num = integer . parse int(str);

Expand:

ParseInt("0 ",10) returns 0.

ParseInt("473 ",10) returns 473.

ParseInt("-0 ",10) returns 0.

ParseInt("-FF ",16) returns -255.

Parseint ("1100110", 2) gets 102.

Parseint ("2 147483647 ",10) returns 2 147483647.

Parseint ("-2 147483648 ",10) returns -2 147483648.

Parseint ("2 147483648 ",10) throws NumberFormatException.

ParseInt("99 ",8) throws NumberFormatException.

ParseInt("Kona ",10) throws NumberFormatException.

ParseInt("Kona ",27) returns 4 1 1787.

Asked if you wanted to know why.