Forums Register Login

Exceptions and Errors

+Pie Number of slices to send: Send
Hi,
While going through exception handling this question has come to my mind. Can anyone please answer them?

Why some cases are defined as exceptions ansd some as Errors in Java?
What are there representation from the system's point of view?
Why we are not allowed to handle Errors like exceptions in java?
+Pie Number of slices to send: Send
You can handle Errors as you can handle Exceptions (both classes extends Throwable, and you can catch Throwables).

But an Error as a particular mining ; From the Javadoc ""An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. ... A method is not required to declare in its throws clause any subclasses of Error that might be thrown during the execution of the method but not caught, since these errors are abnormal conditions that should never occur.
+Pie Number of slices to send: Send
Thanx for the explanation Seb.
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 545 times.
Similar Threads
wrapper
unreachable statement again
Runtime Exception
NoSuchMethodException
What was the need of exceptions classifications?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:51:51.