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

Which is the class in java?

508


How many bytes is string in java?

595


Which class contains a method: cloneable or object?

524


Are variables stored in ram?

543


What is the final access modifier in java?

604






Explain wrapper classes in java?

515


Can we rethrow the same exception from catch handler?

550


What does the three dot emoji mean?

570


What is methodological theory?

516


What are the fileinputstream and fileoutputstream?

560


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

742


What is stored procedure. How do you create stored procedure ?

1476


What does ide stand for?

505


What is the meaning of course?

567


What are the methods of object class ?

552