错误信息已经告诉你了!!
try一下吧,菜鸟
try
{
.........
}
catch(Exception e)
{
e.printStackTrace();
}

解决方案 »

  1.   

    在进行IO操作的时候要使用
    try{}catch(...)这种东西套一下。
      

  2.   

    public class Form 
    {
         try
         {    
    public static void main(String args[])
    {
    System.out.println ("Input String:");
    int i = System.in.read();
    System.out.print (i);
    }
         }
         catch(IOException e)
         {
             //加入自己处理异常的代码
         }
    }如果没有处理异常的代码,也可以这样:
    public class Form 
    {
    public static void main(String args[])  throws IOException
    {
    System.out.println ("Input String:");
    int i = System.in.read();
    System.out.print (i);
    }
    }
      

  3.   

    为什么要在main方法的后面加"throws IOException",这是什么意思?
      

  4.   

    还有try在对IO操作是必须的吗?
      

  5.   

    楼上说得不错,要把它括在try中,才能捕获它可能发生的异常.
      

  6.   

    为什么要在main方法的后面加"throws IOException",这是什么意思?java假定一个方法可以掷出一个异常,如果这个异常是Error或者RuntionException的子类,就不需要在throws列表中指定,所有其它类型的异常都必须被声明,如果不声明就会产生编译期错误。
    你的main()中使用I/O语句了,必须指定IOException。