String str = "1";
int i = Integer.parseInt(str);int t = 123;
String tStr = t+"";

解决方案 »

  1.   

    String => int
     
        int tempInt = 1111;
        String temp = String.valueOf(tempInt);int => String     String tempStr = "1111";
        int tempInt = Integer.parseInt(tempStr);
      

  2.   

    int i=3;
    String s="123";
    s=Integer.toString(i);
    i=Integer.parseInt(s);
      

  3.   

    int tempInt = 1111;
        String temp = String.valueOf(tempInt);这个语句似乎不能实现
      

  4.   

    String => int
     
        int tempInt = 1111;
        String temp = String.valueOf(tempInt);int => String     String tempStr = "1111";
        int tempInt = Integer.parseInt(tempStr);
    完全正确!我经常用
      

  5.   

    哦看错了!!反了
    int => String
     
        int tempInt = 1111;
        String temp = String.valueOf(tempInt);String => Int    String tempStr = "1111";
        int tempInt = Integer.parseInt(tempStr);
      

  6.   

    String.valueOf(Integer)和 Integer.toString(Integer)一样...
      

  7.   

    再给提供一个将String转换为int的办法:
    String StrA = '456';
    int IntB = new Integer(StrA).intValue();
      

  8.   

    Integer.parseInt(String);
    String.ValueOf(Int);
      

  9.   

    Integer.parseInt(String);
    String s=Int+"";