what is difference between Exception and Error?

Answer Posted / vikas deshmukh

both inherit from Throwable, some differences are,

Exceptions:

1)It can be checked or unchecked
2)It indicate an error caused by the programmer
3)It Should be handled at the application level

Errors:

1)Errors are always unchecked
2)Usually indicate a system error or a problem with a low-level resource
3)It should be handled at the system level, if possible

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

design an lru cache in java?

548


What is java regex?

536


Can we call a non-static method from inside a static method?

564


What is pass by value?

515


How do you sort in java?

601






Which is faster string or stringbuilder?

524


What is the byte range?

584


What are the types of methods in java?

582


How does java pattern compile work?

552


Can a class be protected in java?

506


What is meant by class?

547


How do you check if a character in a string is a digit or letter?

516


What is Hierarchy of exception?

653


Difference difference paint() and paintcomponent()?

534


What is the return type of the main method?

580