Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error & Exception

 
sreejith panampilly
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between Error and Exception ?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read their respective Javadoc pages? Pretty well documented classes...
 
Surajit Sahu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic