问题
What does parseInt do exactly?
回答1:
A String cannot be used like an int. With parseInt you can convert a string to an int.
public class Program {
public static void main(String[] args) {
String value = "1000";
// Parse with parseInt: the string can be negative.
int result = Integer.parseInt(value);
System.out.println(result);
System.out.println(result + 1);
来源:https://stackoverflow.com/questions/35264666/what-does-parseint-do-exactly