[My Blog]
All roads lead to JavaRanch
Simran Dass wrote: So, this means Throwable is a checked exception
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
The Throwable class is the superclass of all errors and exceptions in the Java language
SCJP 1.6 96%
So it can be both checked and unchecked.
The unchecked exceptions classes are the class RuntimeException and its subclasses, and the class Error and its subclasses. All other exception classes are checked exception classes.
SCJP 1.6 96%
Neha Daga wrote:when you throw a throwable you can catch it or not as per your wish.
If you dont catch a throwable compiler will not complain
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 1.6 96%
throw new Throwable();
If we do not either handle or declare the exception compilation fails.
Jan Paul Brasser wrote:I'd say that a better design with hindsight would have been to have something like a problem abstraction that a CheckedException and RuntimeException class would inherit/implement, so that they would divert at the right point.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|