answersLogoWhite

0


Best Answer

separating error handling code from 'regular' code

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do you need exception handling codes in a program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is exception handling in object oriented languages?

Exception is a event which can interrupt a normal flow of your program. In other way, exception is a abnormal condition which can occur during the execution of a program. Yes , we can handle exceptions through try, catch, finally, throw and throws.


Why use throw in java in compare try-catch?

we use throws in our program so that we dont need to write try & catch block & to avoid the exception


What is the ICT Technician password for the 2014 laptops given by Kamla?

The program codes are not available outside the provider's security. You need to contact the issuer.


Explain about exception handling with multiple exception?

Exception handling in Java is done through a try-catch-finally block. The "try" block of code is where you put the code which may throw an exception. The "catch" block of code is where you put the code which will execute after an exception is thrown in the try block. This is often used to display an error message, or to mitigate problems caused by the exception. The "finally" block is where you put code that you want to execute after the try and catch blocks have been processed. // example code for catching exception while reading from a file try { // this line of code can throw a FileNotFoundException FileReader in = new FileReader("myfile.txt"); // this line of code can throw an IOException in.read(); } catch(FileNotFoundException ex) { // catch first exception type System.err.println("Cannot find myfile.txt!"); } catch(IOException ex) { //catch second exception type System.err.println("Cannot read from myfile.txt!"); } finally { // no matter what we want to close the file, so do it here // however, this line can also cause an exception, so we need to catch that, too try { in.close(); catch(IOException ex) { // not much we can do about an exception that occurs here } }


Can you describe how Exception Handling is implemented in C plus plus?

Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution

Related questions

What is the need of management by exception?

Exception management is the practice of investigating, resolving and handling such occurrences by using skilled staff and software tools. Good exception management can contribute to efficiency of business processes.


Can program development be done by a program?

Yes and no, program development works in programming codes which are specifically made for humans to be entered, a program can write these programming codes too. The thing is, you would need to write the programming codes yourself before the program can use it in program development. If a program could invent the wheel, then you still need to invent that wheel before the program can. Or atleast until the thinking of the human brain can be translated into mere programming code.


Need universal remote codes?

To program your universal remote, you will need to know the brand of remote that you own. Once you have figured that out, go to the website of the manufacturer, and they will have instructions listed on how to program your remote.


What is exception handling in object oriented languages?

Exception is a event which can interrupt a normal flow of your program. In other way, exception is a abnormal condition which can occur during the execution of a program. Yes , we can handle exceptions through try, catch, finally, throw and throws.


How do you make a operating system?

You need how to program and you have to put in codes. Then you know how to make one.


GE 24914 Universal Remote Control codes for 20 in Emerson TV?

I'm trying to program the remote to a Sanyo TV need codes loss instructions


How do you program keyless entry on a 1996 grand am?

bring it to a dealer or a shop that puts them in you need a special computer and codes


Where are the cyberhome remote codes for sharp ga035sb universal remote?

i need program instructions or sharp ga035sb univer remote


Why use throw in java in compare try-catch?

we use throws in our program so that we dont need to write try & catch block & to avoid the exception


Does gold need special handling?

yes gold needs special handling


What is the ICT Technician password for the 2014 laptops given by Kamla?

The program codes are not available outside the provider's security. You need to contact the issuer.


How to you program codes in GPT universal remote control RM-788?

To program codes in a GPT universal remote control, RM-788, first you need to know the make and model of your television set. Then you find that code number on the pamphlet that came with the remote and enter it on the remote.