{"id":22113,"date":"2016-10-17T16:45:28","date_gmt":"2016-10-17T16:45:28","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=22113"},"modified":"2024-12-14T04:08:39","modified_gmt":"2024-12-14T04:08:39","slug":"difference-between-error-and-exception","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/difference-between-error-and-exception\/","title":{"rendered":"Difference between Error and Exception?"},"content":{"rendered":"<h1>Difference between Error and Exception?<\/h1>\n<p>Let&#8217;s learn the difference between Error and Exception.<\/p>\n<h2>Error<\/h2>\n<p>Errors indicate serious problems or abnormal conditions in the application. The application might not catch or handle the error and may lead to an application crash.<\/p>\n<p><em>public class Error extends Throwable {<\/em><\/p>\n<p>Error and its subclasses are regarded as unchecked exceptions. Unchecked exceptions do not need to be declared in a method\/constructor&#8217;s <em>throws<\/em> clause if they are thrown by the execution of the method\/constructor and propagate outside the method\/constructor boundary.<\/p>\n<h2>Exception<\/h2>\n<p>Exceptions are unwanted events that interrupt the normal program execution flow.<\/p>\n<p><em>public class Exception extends Throwable {<\/em><\/p>\n<p>Exception and its subclasses are regarded as checked exceptions. Checked exceptions need to be declared in a method\/constructor&#8217;s <em>throws<\/em> clause.<\/p>\n<p>Note that the subclasses of the <em>RuntimeException<\/em> are unchecked exceptions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Difference between Error and Exception? Let&#8217;s learn the difference between Error and Exception. Error Errors indicate serious problems or abnormal conditions in the application. The application might not catch or handle the error and may lead to an application crash. public class Error extends Throwable { Error and its subclasses are regarded as unchecked exceptions. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-22113","post","type-post","status-publish","format-standard","hentry","category-java","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/22113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=22113"}],"version-history":[{"count":11,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/22113\/revisions"}],"predecessor-version":[{"id":26381,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/22113\/revisions\/26381"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=22113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=22113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=22113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}