test\SwitchDemo.java:9: 未报告的异常 java.io.IOException;必须对其进行捕捉或声明以便抛出
              char c;  c=(char)System.in.read();
程序可以运行,但是不能进行输入操作,是什么问题啊?急死人了
                                      ^

解决方案 »

  1.   

    编译就没通过吧,你运行的应该是之前编译过的程序try catch 试试
      

  2.   

    public class Read {
    public static void main(String[] args) { 
    try{
    char c=(char)System.in.read();
    System.out.println(c);
    }
    catch(Exception e){}
    }
    }
      

  3.   

    public class Read {
    public static void main(String[] args) { 
    try{
    char c=(char)System.in.read();
    System.out.println(c);
    }
    catch(Exception e){
    e.printStackTrace();
    }
    }
    }