java.lang.Error: Unresolved compilation problem: 
Unhandled exception type IOException at com.hui.hello.main(hello.java:18)
Exception in thread "main" 

解决方案 »

  1.   

    你的main方法里面有需要抛出IOException的地方却没有捕捉你在main方法上throw Exception就可以了
      

  2.   

    同意楼上的加上try...catch也行的。。反正异常要处理的
      

  3.   

    public class hello
    { /**
     * @param args
     */
    public static void main(String[] args) throws Exception
    {
    //String mystring;
    int count=0;
    //int j;
    System.out.println("please input a number:");
    //j=System.in.read();
    int j;
            //j=0;
            j=System.in.read();
            while(count==j)
    {
             System.out.print("input a command for exit!");
             //mystring=System.in.toString();
                      
            }
            System.out.println("this a number:"+j);
    }
    }
    帮忙运行一下,然后解释一下结果为什么是这样?不懂!!谢了!!
      

  4.   

    System.in.read();读入的是下一个byte值,好象是输入的int的Ascii码值。
      

  5.   

    同楼上,System.in.read()读入的是Ascii编码的值