Why do we have Exceptions ( IOException
, for example) and Errors ( OutOfMemoryError
, for example)?
I know that both inherit from the Throwable
class, but What is the difference between them?
Why do we have Exceptions ( IOException
, for example) and Errors ( OutOfMemoryError
, for example)?
I know that both inherit from the Throwable
class, but What is the difference between them?
Based on in this gringo OS answer :
Error
s are very large issues that should not be handled or thrown.
They are problems that when they happen, do not have much to do.
Already Exception
s can be handled and thrown. They may represent large problems, but nothing compared to problems of type Error
.