integer.parseint
时间: 2023-11-14 13:07:20 浏览: 73
ParseInteger.java
The parseInt() method in Java is used to convert a string to an integer. It takes two arguments - the string to be converted and the radix (base) of the number system to be used.
Syntax:
```
public static int parseInt(String str, int radix)
```
Example:
```
String str = "123";
int num = Integer.parseInt(str);
```
In this example, the string "123" is converted to an integer value of 123 using the parseInt() method.
阅读全文