Create a class named UncheckedException, which must inherit from an unchecked exception. Inside the UncheckedExceptionclass declare a no-argument constructor.
Hierarchy of exceptions
UncheckedException
Report a typo
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);
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.