如取到String的“2345”  转化为int型的2345

解决方案 »

  1.   

    首先要判断是否为空,直接转换要抛出空指针异常的:
    如String waitJustiy = “2345”;
    if(!(waitJustiy  == null || waitJustiy .equals(""))) {
        int afterJustiy = Integer.parseInt("waitJustiy ")
    }
    这样在运行时就不会抛出空指针异常了。
      

  2.   

    String superMan = “2345”;
    if(!(superMan  == null || superMan .equals(""))) {
        int superSon= Integer.parseInt("superMan ")
    }