add exception constructors

This commit is contained in:
Zack Buhman 2025-01-13 18:05:16 -06:00
parent 391fcf6738
commit 73012dc048
21 changed files with 259 additions and 0 deletions

View File

@ -1,4 +1,12 @@
package java.lang; package java.lang;
public class ArithmeticException extends RuntimeException { public class ArithmeticException extends RuntimeException {
public ArithmeticException() {
super();
}
public ArithmeticException(String s) {
super(s);
}
} }

View File

@ -1,4 +1,16 @@
package java.lang; package java.lang;
public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException { public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
ArrayIndexOutOfBoundsException() {
super();
}
ArrayIndexOutOfBoundsException(int index) {
super(String.valueOf(index));
}
ArrayIndexOutOfBoundsException(String s) {
super(s);
}
} }

View File

@ -1,4 +1,11 @@
package java.lang; package java.lang;
public class ArrayStoreException extends RuntimeException { public class ArrayStoreException extends RuntimeException {
public ArrayStoreException() {
super();
}
public ArrayStoreException(String s) {
super(s);
}
} }

View File

@ -1,4 +1,12 @@
package java.lang; package java.lang;
public class ClassCastException extends RuntimeException { public class ClassCastException extends RuntimeException {
public ClassCastException() {
super();
}
public ClassCastException(String s) {
super(s);
}
} }

View File

@ -0,0 +1,17 @@
package java.lang;
public class ClassNotFoundException extends RuntimeException {
public ClassNotFoundException() {
super();
}
public ClassNotFoundException(String s) {
super(s);
}
public ClassNotFoundException(String s,
Throwable ex) {
super(s, ex);
}
}

View File

@ -0,0 +1,12 @@
package java.lang;
public class CloneNotSupportedException extends RuntimeException {
public CloneNotSupportedException() {
super();
}
public CloneNotSupportedException(String s) {
super(s);
}
}

View File

@ -0,0 +1,12 @@
package java.lang;
public class IllegalAccessException extends Exception {
public IllegalAccessException() {
super();
}
public IllegalAccessException(String s) {
super(s);
}
}

View File

@ -0,0 +1,21 @@
package java.lang;
public class IllegalArgumentException extends RuntimeException {
public IllegalArgumentException() {
super();
}
public IllegalArgumentException(String s) {
super(s);
}
public IllegalArgumentException(String message,
Throwable cause) {
super(message, cause);
}
public IllegalArgumentException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,12 @@
package java.lang;
public class IllegalMonitorStateException extends RuntimeException {
public IllegalMonitorStateException() {
super();
}
public IllegalMonitorStateException(String s) {
super(s);
}
}

View File

@ -0,0 +1,21 @@
package java.lang;
public class IllegalStateException extends RuntimeException {
public IllegalStateException() {
super();
}
public IllegalStateException(String s) {
super(s);
}
public IllegalStateException(String message,
Throwable cause) {
super(message, cause);
}
public IllegalStateException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,12 @@
package java.lang;
public class IllegalThreadStateException extends RuntimeException {
public IllegalThreadStateException() {
super();
}
public IllegalThreadStateException(String s) {
super(s);
}
}

View File

@ -1,4 +1,12 @@
package java.lang; package java.lang;
public class IndexOutOfBoundsException extends RuntimeException { public class IndexOutOfBoundsException extends RuntimeException {
public IndexOutOfBoundsException() {
super();
}
public IndexOutOfBoundsException(String s) {
super(s);
}
} }

View File

@ -0,0 +1,12 @@
package java.lang;
public class InstantiationException extends Exception {
public InstantiationException() {
super();
}
public InstantiationException(String s) {
super(s);
}
}

View File

@ -0,0 +1,12 @@
package java.lang;
public class InterruptedException extends Exception {
public InterruptedException() {
super();
}
public InterruptedException(String s) {
super(s);
}
}

View File

@ -1,4 +1,12 @@
package java.lang; package java.lang;
public class NegativeArraySizeException extends RuntimeException { public class NegativeArraySizeException extends RuntimeException {
public NegativeArraySizeException() {
super();
}
public NegativeArraySizeException(String s) {
super(s);
}
} }

View File

@ -1,4 +1,12 @@
package java.lang; package java.lang;
public class NullPointerException extends RuntimeException { public class NullPointerException extends RuntimeException {
public NullPointerException() {
super();
}
public NullPointerException(String s) {
super(s);
}
} }

View File

@ -0,0 +1,12 @@
package java.lang;
public class NumberFormatException extends IllegalArgumentException {
public NumberFormatException() {
super();
}
public NumberFormatException(String s) {
super(s);
}
}

View File

@ -1,4 +1,20 @@
package java.lang; package java.lang;
public class RuntimeException extends Exception { public class RuntimeException extends Exception {
public RuntimeException() {
super();
}
public RuntimeException(String message) {
super(message);
}
public RuntimeException(String message,
Throwable cause) {
super(message, cause);
}
public RuntimeException(Throwable cause) {
super(cause);
}
} }

View File

@ -0,0 +1,21 @@
package java.lang;
public class SecurityException extends RuntimeException {
public SecurityException() {
super();
}
public SecurityException(String s) {
super(s);
}
public SecurityException(String message,
Throwable cause) {
super(message, cause);
}
public SecurityException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,16 @@
package java.lang;
public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
public StringIndexOutOfBoundsException() {
super();
}
public StringIndexOutOfBoundsException(int index) {
super(index);
}
public StringIndexOutOfBoundsException(String s) {
super(s);
}
}

View File

@ -0,0 +1,4 @@
package java.lang;
public class UnsupportedOperationException extends RuntimeException {
}