1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18package java.lang; 19 20 21/** 22 * {@code Exception} is the superclass of all classes that represent recoverable 23 * exceptions. When exceptions are thrown, they may be caught by application 24 * code. 25 * 26 * @see Throwable 27 * @see Error 28 * @see RuntimeException 29 */ 30public class Exception extends Throwable { 31 private static final long serialVersionUID = -3387516993124229948L; 32 33 /** 34 * Constructs a new {@code Exception} that includes the current stack trace. 35 */ 36 public Exception() { 37 } 38 39 /** 40 * Constructs a new {@code Exception} with the current stack trace and the 41 * specified detail message. 42 * 43 * @param detailMessage 44 * the detail message for this exception. 45 */ 46 public Exception(String detailMessage) { 47 super(detailMessage); 48 } 49 50 /** 51 * Constructs a new {@code Exception} with the current stack trace, the 52 * specified detail message and the specified cause. 53 * 54 * @param detailMessage 55 * the detail message for this exception. 56 * @param throwable 57 * the cause of this exception. 58 */ 59 public Exception(String detailMessage, Throwable throwable) { 60 super(detailMessage, throwable); 61 } 62 63 /** 64 * Constructs a new {@code Exception} with the current stack trace and the 65 * specified cause. 66 * 67 * @param throwable 68 * the cause of this exception. 69 */ 70 public Exception(Throwable throwable) { 71 super(throwable); 72 } 73} 74