what is difference between Exception and Error?

Answer Posted / shabana

n general error is which nobody can control or guess when it
occurs.Exception can be guessed and can be handled. In Java
Exception and Error are sub class of Throwable.It is
differentiated based on the program control.Error such as
OutOfMemory Error which no programmer can guess and can
handle it.It depends on dynamically based on architectire,OS
and server configuration.Where as Exception programmer can
handle it and can avoid application's misbehavior.For
example if your code is looking for a file which is not
available then IOException is thrown.Such instances
programmer can guess and can handle it.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain abstract class in java?

560


How many threads can java run?

561


What are default methods ?

580


Is ruby built on java?

535


What is visibility mode?

533






What is the best way to findout the time/memory consuming process?

556


Why hashset is used in java?

538


Which are the two subclasses under exception class?

531


Is java call by reference?

533


What is return code?

560


What is difference between jdk,jre and jvm?

571


What 4 doubled?

544


What is public/private protected in java?

548


hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea

1463


Why we use methods in java?

542