char x = (char)System.in.read();
从键盘输入读取一个字符。推荐下面的方法。
BufferedReader in = new BufferedReader(new InputSteamReader(System.in));
char c = (char)in.read();

解决方案 »

  1.   

    import java.io.*;public class Test{
    public static void main(String[] args) throws Exception{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    char c = (char)in.read();
    System.out.println(c);
    }
    }注意 litant919(litant)写的中间有错。
      

  2.   

    import java.io.*;public class test{
    public static void main(String[] args) throws Exception{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String c;
    c =in.readLine();
    System.out.println(c);
    }
    }
      

  3.   

    村干部你的还是报错,和上个一样的,所以希望gankuai改一下,我好付款~~~~~~
      

  4.   

    import java.io.*;public class Test {
    public static void main(String[] args) throws Exception{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String c;
    c = in.readLine();
    System.out.println(c);
    }
    }
      

  5.   

    BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
    String response;
    try {
    while((response=in.readLine())!=null)
    {
    System.out.println(response);
    in.close(); }
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }