如题

解决方案 »

  1.   

    throw new Exception();
    try{
    ;
    }catch(Exception e)
    {
    ;
    }
      

  2.   

    try{
     int a=1/0;
    }catch(Exception ){
     System.out.println(e.toString);
    }
      

  3.   

    public class T{
     public static throwException()throws Exception{
     int a=1/0;
     }
     
     public static void main(String args[]){
      try{
       throwException();
      }catch(Exception e){
       System.out.println(e.toString);
      }
     }
    }
      

  4.   

    public static throwException()throws Exception改成
    public static void throwException()throws Exception
      

  5.   

    这叫异常,不叫错误,异常和错误是不一样的,异常是Exception,但错误是Error,两个是完全不一样的概念。