String  str = "1234";
int num = new Integer(str).intValue();

解决方案 »

  1.   

    这种问题不要再问了
    已经被问过 N 遍了
    1.
    String  Str1="1234";
    int n = new Integer(Str1).intValue();2.
    String  Str1="1234";
    int i =Integer.parseInt(Str1);
      

  2.   

    String  Str="1234";
    int num1;
    num1=Integer.parseInt(Str1);
      

  3.   

    String s = "4321";
    int i = Integer.parseInt(s);
    System.out.println(i);
    //4321
      

  4.   

    try{
    String s = "4321";
    int i = Integer.parseInt(s);
    }catch(NumberFormatException e)好象叫这名字把....