answersLogoWhite

0

How exception handling is different from error?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

we know that exception can happen ..but we dont know about errors .. we dont have knowledge about them in already ...but in case of exception we take some prevential actions and put already an exception block to catch that exception

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How exception handling is different from error?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why do you need exception handling codes in a program?

separating error handling code from 'regular' code


What is exception handling in C plus plus?

Exception handling is the means by which exceptions -- anomalous events -- are resolved without causing a runtime error.


What is exception handling in php?

Exception handling, also known as error handling, is a process that involves creating "exception handlers" to deal with many problems that can occur with a PHP script. This code will "catch" the error, and deal with it in some fashion other than crashing and ending the script. This allows programmers to deal with such issues without causing their website to go down or cause other problems.


Why would you want to use user defined exception handling?

sometimes there are situations where the program is vary long which can make error debugging a long process so java provides a facility to make user defined exception handling suppose we are dividing two numbers a/b and if the user enters the value of b 0, the user wants to display an error of your own so the user can do this by using exception handling


How do you use exception in c sharp?

Exceptions are the error handling mechanism of C#. When an error occurs, an exception is thrown using this syntax: void BadMethod() { bool Error = true; if (Error) { throw new Exception("Whoops!"); } } Methods can then handle exceptions using a try/catch/finally syntax. The code that you are trying to execute goes between a try { } block, the code to handle the error goes between the catch { } block. Any code that you put between the finally { } block will always execute after the exception handling code is complete (or if an error did not occur). void test() { try { BadMethod(); catch (Exception ex) { Console.WriteLine("An error occured. The description is: " + ex.Description); } finally { Console.WriteLine("I'm done!"); } }


Advantages of Exception handling in java?

Exception handling helps us catch or identify abnormal scenarios in our code and handle them appropriately instead of throwing up a random error on the front-end (User Interface) of the application. Exception handling allows developers to detect errors easily without writing special code to test return values. Even better, it lets us keep exception-handling code cleanly separated from the exception-generating code. It also lets us use the same exception-handling code to deal with a range of possible exceptions.


Why you handle exception in java?

Exception handling helps us catch or identify abnormal scenarios in our code and handle them appropriately instead of throwing up a random error on the front-end (User Interface) of the application. Exception handling allows developers to detect errors easily without writing special code to test return values. Even better, it lets us keep exception-handling code cleanly separated from the exception-generating code. It also lets us use the same exception-handling code to deal with a range of possible exceptions


What is difference between exception handling in C and Java?

Easy: there is no exception-handling in C.


What is the exact difference between interrupt handling and exception handling?

interrupt handling is the process of handling a break or interrupt called by a program where as exception handling is for handling some exceptional conditions that'll occur when a program is running


When is exception handling necessary for stream handling?

Exception handling is necessary for string handling as there might be some unexpected situation during string handling which may lead to program crash or abrupt termination


Can exception handling resolve the abnormal flow of a program?

An exception is abnormal program flow, so handling the exception is the very definition of resolving the abnormality.


What are the main differences between user-defined exceptions and system-defined exception?

Systems don't throw exceptions. System errors are low-level errors which you have to detect programmatically. In C, most functions that cause system errors will typically return -1 to indicate an error has occurred and 0 to indicate no error. If an error occurs, you should examine the global errno variable to determine the actual error code (as defined in <errno.h>). You can use the strerror() function to obtain a pointer to the string representation of the error, and perror() to display the error. If you cannot handle the error there and then, then you should pass the error to your error handling code. Languages that support exception handling make it easy to pass errors from the point they are detected to a point where they can be handled. Simply transform the error code into an exception object and then throw the object, allowing the exception handling mechanism to deal with it.