answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Advantages of Exception handling in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is difference between exception handling in C and Java?

Easy: there is no exception-handling in C.


What is the purpose of NoMatchException handling method in java?

java exception


When should we use exception handling in java?

Exception handling should be used in Java in all cases where you as a programmer suspect that your code might throw some exceptions or create errors that might look ugly when a user is using the application. In such cases you use exception handling to catch and handle the exception and exit gracefully. You use the try - catch block in Java for exception handling.


Which is the base class of exception handling in java?

Thorwable


Is exception handling implicit or explicit?

In Java, Exception Handling is Explicit. The Programmer has to write code that will ensure that the exceptions are caught and appropriately handled


A program to explain the Exception Handling mechanisms in Java using the keywords try catch and finally?

Here is a code snippet illustrating exception handling: try { int a= 3 / 0 ; } catch ( ArithmeticException e ) { System.out.println ("An ArithmeticException has occured"); } finally { // some code }


What are the advantages and disadvantages event handler to event properties?

what are the advantages and dis advantages of event handling in java


What is syntax for exceptional handling in java?

try{ statements; } catch(Exception e) { message }


Does the Java exception mechanisms with try and catch clauses contribute to failure tolerance?

Yes, the purpose of the try-catch construct in Java is to help the system handle failure gracefully. 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.


How exception handling differs in C plus plus and Java?

Exception handling is largely the same for both. The only real difference is that C++ has no 'finally' clause which always executes whether an exception occurs or not. Another difference is that Java throws exceptions and errors, but errors cannot be handled since programs cannot handle errors -- such as the JVM out of memory error.


What keyword are used in java for exception handling?

The important keywords used in Java with respect to Exception Handling are: a. Throw - The "throw" keyword is used to throw exceptions from inside a method b. Throws - The "throws" keyword is used to signify the fact that the code contents within the current method may be throwing an exception and the calling method must handle them appropriately


What are the features of core java?

Core java refers to the core or basic concepts of the Java programming language. Things like encapsulation, inheritance, multi-threading, exception handling and other basic feature of java that comes as part of the Java standard edition forms Core Java