zoukankan      html  css  js  c++  java
  • 13、Java 异常处理

    1

    退JavaJava

    Javathrow JavaJRE

    2

    Javatrycatchfinallythrowthrows

    3

    IOException
    ArithmeticExecption
    NullPointerException
    ClassCastException
    SQLException
    FileNotFoundException
    NegativeArrayException
    ArrayIndexOutOfBoundsException
    SecturityException
    EOFException
    NumberFormatException
    NoSuchMethodException

    4

    4.1trycatch
    try{

       // 

      }catch(ExceptionName e1){

       //Catch 

    }
    4.2throws

    使throws使throws

    4.3throw

    throwtry

    4.4

    tryfinallyfinallytry使

    使finally

    finally {
       // Code for finally block
    }

    5

    Java Exceptionchecked exceptionRuntimeException

    StringStringThrowableThrowable

    package java.io;

    public class IOException extends Exception {
       static final long serialVersionUID = 7818375828146090155L;

       public IOException() {
    super();
      }

       public IOException(String message) {
    super(message);
      }

       public IOException(String message, Throwable cause) {
           super(message, cause);
      }

       public IOException(Throwable cause) {
           super(cause);
      }
    }

    6

    使

    try {
       // May throw Exception1, Exception2, or Exception3
    }
    catch (Exception1 | Exception2 | Throwable    e) {
       // Handle Exceptions here
    }

    
    
  • 相关阅读:
    zTree实现地市县三级级联封装类
    zTree实现地市县三级级联报错(二)
    zTree实现地市县三级级联报错(一)
    FusionCharts报错
    当分页语句遇到union all
    两表关联更新,用于update 回滚
    Invalid file system control data detected
    expect: spawn id exp4 not open
    目的可疑,但方法很值得学习的书——leo鉴书56
    下载jQuery EasyUI出现网络问题
  • 原文地址:https://www.cnblogs.com/naimao/p/13346524.html
Copyright © 2011-2022 走看看