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 18 package 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 * @since Android 1.0 30 */ 31 public class Exception extends Throwable { 32 private static final long serialVersionUID = -3387516993124229948L; 33 34 /** 35 * Constructs a new {@code Exception} that includes the current stack trace. 36 * 37 * @since Android 1.0 38 */ Exception()39 public Exception() { 40 super(); 41 } 42 43 /** 44 * Constructs a new {@code Exception} with the current stack trace and the 45 * specified detail message. 46 * 47 * @param detailMessage 48 * the detail message for this exception. 49 * @since Android 1.0 50 */ Exception(String detailMessage)51 public Exception(String detailMessage) { 52 super(detailMessage); 53 } 54 55 /** 56 * Constructs a new {@code Exception} with the current stack trace, the 57 * specified detail message and the specified cause. 58 * 59 * @param detailMessage 60 * the detail message for this exception. 61 * @param throwable 62 * the cause of this exception. 63 * @since Android 1.0 64 */ Exception(String detailMessage, Throwable throwable)65 public Exception(String detailMessage, Throwable throwable) { 66 super(detailMessage, throwable); 67 } 68 69 /** 70 * Constructs a new {@code Exception} with the current stack trace and the 71 * specified cause. 72 * 73 * @param throwable 74 * the cause of this exception. 75 * @since Android 1.0 76 */ Exception(Throwable throwable)77 public Exception(Throwable throwable) { 78 super(throwable); 79 } 80 } 81