String aa="999,999";
int i;
try
{
  i=Integer.parseInt(aa.trim());
}
catch(NumberFormatException e)
{
...
}

解决方案 »

  1.   

    int型最大只能表示2的23次方的数!!!!!
    一般的可以:new Integer("9999").intValue();
      

  2.   

    999,999,999可能超过integer的范围了
      

  3.   

    若是int不行,为什么不用Double.parseDouble("999,999")呢
      

  4.   

    StringTokenizer tt = new StringTokenizer("999,999,999",",");
    System.out.println(tt);
    String es="";
    while (tt.hasMoreElements()) {    es=(String)tt.nextElement()+es;
        System.out.println(es);
        }
    int wi=Integer.parseInt(es);
    System.out.println(wi);结果为:999999999
      

  5.   

    抱歉,没有System.out.println(tt);这句话。
      

  6.   

    StringTokenizer
    public StringTokenizer(String str,
                           String delim,
                           boolean returnDelims)Constructs a string tokenizer for the specified string. All characters in the delim argument are the delimiters for separating tokens. 
    If the returnDelims flag is true, then the delimiter characters are also returned as tokens. Each delimiter is returned as a string of length one. If the flag is false, the delimiter characters are skipped and only serve as separators between tokens. 
    Parameters:
    str - a string to be parsed.
    delim - the delimiters.
    returnDelims - flag indicating whether to return the delimiters as tokens.--------------------------------------------------------------------------------StringTokenizer
    public StringTokenizer(String str,
                           String delim)Constructs a string tokenizer for the specified string. The characters in the delim argument are the delimiters for separating tokens. Delimiter characters themselves will not be treated as tokens. Parameters:
    str - a string to be parsed.
    delim - the delimiters.--------------------------------------------------------------------------------StringTokenizer
    public StringTokenizer(String str)Constructs a string tokenizer for the specified string. The tokenizer uses the default delimiter set, which is " \t\n\r\f": the space character, the tab character, the newline character, the carriage-return character, and the form-feed character. Delimiter characters themselves will not be treated as tokens. Parameters:
    str - a string to be parsed.
      

  7.   

    注意:
    1.int型最大可为:2,147,483,647
    2.要去了字符中的‘,’