my dog learned polymorphism
The moose likes Java in General and the fly likes Error & Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Error & Exception " Watch "Error & Exception " New topic

Error & Exception

sreejith panampilly
Ranch Hand

Joined: Jun 15, 2006
Posts: 49
What is the difference between Error and Exception ?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Did you read their respective Javadoc pages? Pretty well documented classes...

[Jess in Action][AskingGoodQuestions]
Surajit Sahu

Joined: Sep 06, 2006
Posts: 2
Error means something that has gone wrong with your program which we
can not overcome, whereas an exception is for an unusual situation that we will face in a code.So, for example, tack overflow,underflow
are examples of Error, but attempting to read a file and finding it doesn't exist,a divide-by-zero are examples of Exception.So Exception we can handel by putting that part of code which we are anticipating some exception may occur,in try and catch block.But error we can't handel explicitly where as exception we can.
I agree. Here's the link:
subject: Error & Exception
It's not a secret anymore!