Solved

Difference Between Error Handling and Exception Handling

Posted on 2006-11-03
2
421 Views
Last Modified: 2010-03-31
Can anyone describe the difference between Java error handling and exception handling. I do not understand.

Do all errors and exceptions have to be handled by the programmer?

0
Comment
Question by:tristatefab
2 Comments
 
LVL 13

Accepted Solution

by:
marchent earned 80 total points
ID: 17870040
String []a = new String[10];
System.out.println(a[i]);

here if the value of i get more than 10 or less than 0 then program will crash.

error handling:
if(i < 10 && i >= 0)  System.out.println(a[i]);

exception handling:
try
{System.out.println(a[i]);}
catch(Exception e)
{System.out.println("ur array index is invalid");}

~marchent~
0
 
LVL 4

Assisted Solution

by:NorCal2612
NorCal2612 earned 45 total points
ID: 17870854
Exception handling is just one type of error handling (probably the best approach imo :)).

Other ways to indicate errors are just with variables that are set to a specific value if an error occurs during the execution of a program and are checked periodically.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Issues installing SSL certificate into Apache Tomcat 3 70
word0 challenge 3 59
word0 challenge 4 54
Python Assistance 7 36
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now