UncheckedException

Report a typo

Create a class named UncheckedException, which must inherit from an unchecked exception. Inside the UncheckedExceptionclass declare a no-argument constructor.

Write a program in Java 17
// update the class
class UncheckedException extends ...{

}

//do not change the code
class Main {
public static void main(String[] args) {
UncheckedException uncheckedException = new UncheckedException();
System.out.println(uncheckedException instanceof RuntimeException);
}
}
___

Create a free account to access the full topic