answersLogoWhite

0

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

13y ago

What else can I help you with?

Related Questions

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.


Why do you need exception handling codes in a program?

separating error handling code from 'regular' code


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.


What is difference between exception handling in C and Java?

Easy: there is no exception-handling in C.


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


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 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


Is error and exception same?

Error: Any departure from the expected behavior of the system or program, which stops the working of the system is an error. Exception:Any error or problem which one can handle and continue to work normally. Note that in Java a compile time error is normally called an "error," while a runtime error is called an "exception." Errors don't have subclasses while exception has two subclasses, they are compile time exception or checked exception (ClassNotFound Exception, IOException, SQLException etc.) and runtime or unchecked exception(ArrayIndexOutOfBounds Exception, NumberFormat Exception).


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