public static int parseInt(String s) throws NumberFormatException Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign ‘-’ (’\u002D’) to indicate a negative value or an ASCII plus sign ‘+’ (’\u002B’) to indicate a positive value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseInt(java.lang.String, int) method. _ Parameters: s - a String containing the int representation to be parsed Returns: the integer value represented by the argument in decimal. Throws: NumberFormatException - if the string does not contain a parsable integer.
中文翻译
我来简单翻译一部分。
对于Integer类的静态方法public static int parseInt(String s) throws NumberFormatException 它能够将String类型的参数,解析为一个带符号的十进制整数。字符串中的字符,必须是十进制数字,在这个十进制数字的第一个字符前,可以是ASCII字符的-或Unicode字符的'\u002D来表明这是一个负值,或者是一个ASCII字符的+或Unicode字符的'\u002B来表明这是一个正值。这个作为结果的整数值会被return,如果使用方法parseInt(java.lang.String, int)并为其传参(String s,10)也能达到和当前方法一样的效果。