public class ReanInt { public static void main(String[] args){
if (null != args[0]){
int readint = Integer.parseInt(args[0]);
}
}
}

解决方案 »

  1.   

    cannot resolve symbol
    symbol  : method parseInt (java.io.InputStream)
    location: class java.lang.Integer
                    int readint = Integer.parseInt(System.in);
                                         ^
    1 error这是怎么回事呢?
      

  2.   

    Integer.parseInt(String s);
    参数是String类型的,System.in不是String类型的
      

  3.   

    那可不可以直接读入一个int型的值另外怎样读入一个String
      

  4.   

    BufferedReader stdin =
                new BufferedReader(
                new InputStreamReader(System.in));
            System.out.print("Enter a line:");
            String value = stdin.readLine();            //得到一个从控制台输入的字符串
            int iValue = Integer.parseInt(value);       //把该字符串转换为int
            System.out.println(iValue);
      

  5.   

    c=getchar()
    为什么c里这么简单呢
      

  6.   

    因为它是c其实就是封装了一下而。java也可以把上面这几句话封装一下,作为一个getChar()方法来用啊。