-10

Why errors are not handled? Since Error class is derived from Throwable class(JAVA) it can also be handled.But why it is not a good practice to handle the error?

Arian Motamedi
  • 7,123
  • 10
  • 42
  • 82
Praburaj
  • 613
  • 8
  • 21
  • 9
    The Question doesnt really make any sense? – Softwarehuset Aug 08 '14 at 18:54
  • 1
    I don't think this has anything to do with C#. – Arian Motamedi Aug 08 '14 at 18:55
  • Please clarify your question because for now there is nothing to understand from it...! – Simon Aug 08 '14 at 18:56
  • 1
    `Error` indicates that really, really, bad things that are hard to recover from have happened (i.e. `OutOfMemoryError`). Why would you want to recover from that without first making sure that the environment is stable and restarting the application? – Makoto Aug 08 '14 at 18:59
  • possible duplicate of [When to catch java.lang.Error?](http://stackoverflow.com/questions/352780/when-to-catch-java-lang-error) – azurefrog Aug 08 '14 at 19:36

1 Answers1

1

Compilers are not predictive to get the result exactly in the format humans want.

They obviously work on the limited syntax and semantics rule and as per some grammar (or rules you can say).

Errors are also Exceptions in Java that define exceptions which aren't expected to be caught under normal circumstances.

So basically, an error is that problem which requires human handling for getting the correct result. Also, your assumption that errors aren't handled is incorrect, as errors are reported like errors occurring during runtime. But, they don't specifically correct the error and also they don't provide much detail about the error.

Sam
  • 7,252
  • 16
  • 46
  • 65
Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73