(char)System.in.read()中(char)是什么作用呢?

解决方案 »

  1.   

    (char)  转行  就是把数字转化为字符
      

  2.   

    "如果我想输入1,c=1用什么语句?谢谢"int c;
    String s;
    s = System.in.read();
    c = Integer.parseInt( s );
      

  3.   

    呵呵楼上的搞错了吧。是l不是1, 而且你这样做好像是不对的。
    (char)是type casting
      

  4.   

    BufferedReader br=
    new BufferedReader(new InputStreamReader(System.in));
    s=br.readLine();
    a=Integer.parseInt(s);
    这样行不?和s = System.in.read();
    c = Integer.parseInt( s );
    有什么区别啊?