Difference between error and an exception? October 5, 2006
Posted by :) in JAVA.trackback
An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not exist. Or a NullPointerException will take place if you try using a null reference. In most of the cases it is possible to recover from an exception (probably by giving user a feedback for entering proper values etc.).


Hi Allu,
This is good site.
Thanks for providing these kind of information at one place.
thanks
Regards
Prasad
hi this is santhosh from banglore plz send some real time tips and applications regarding struts.how do u get ejb bean in struts.plz send immediately.plz send some projects specification that r related to banking or insurance or sales domain.and send an application how to design in struts.plz i m requesting u and i believe that u will send
thanks
bye………..
hai,
1——can anyone explain me why should we go for collections?
2—–when should i use static blocks
what is the difference between throw and throws in exception handling
Hai,
Thanks for clarification about the throw and throws.
I have another question. How to create dsn(also how to check whether dsn created is succesful) for establishing the jdbc connection using the jdbcodbcbridge driver and do we need any .jar or other type of files in this regard.
Hi ,
Srinivas this is good for interview going people .
thank u
Hi sir can you tell me why threads are said to be lightweight and please tell me what is the difference between lightweight and heavyweight components.
what is the difference between error and exception ?
main difference is
In case of exception, we can use wxception handler to overcome the exception and continue with the normal execution of the program.
There might be some checked and some unchecked exceptions.
most of the exceptions can be handled.
but in case of error, there is no error handler as such to handle those.
There are some tipical error classes such as LinkerError,VirtualMachineError,ThreadDeath etc. can not be handled explicitly. These are irrecoverable.This is the main Difference.
NOTE–> If you know anything more then please let me know.
nice explanation
thank you
why the class cannot be declared as private and protected?
bcz when we use private or protected the access of the class is limited.
when we use private we cant even try to call that class from other class
when we use protected we cant call the class from other package. but we
can use those sub classes of the protected classes any where.but by using public there is no restriction
Difference Between Throws And Throw is That the preceeded one is used for specifying that a function will throw an exception of particular type such as
public void run() throws InterruptedException
{
try
{
//some code here which generates exception
}
catch()
{
throw InterruptedException()
}
}
The Key word throw is used for Rethrowing An Exception from child Function to parent(calling) function and managing it out there
Hi this is sridhar
can u give any real life example and real time example for Abstraction and Encapsulation………..
plz ASAP
Hi This is sridhar…….
Can u give clarification about Checked Exception and Unchecked Exceptions ……..
checked exceptions r compile time and Unchecked Exceptions r Run time. is it right………..?
but Exceptions are occurring at run time……..?
Can u explain me about the Abtract class and interfaces?difference between them?
why sun provided errors and exceptions separately ? Why not given only exceptions ?
Hi Srinu,
This info is looking good, I think you can provide some more info on this…
Thanks, VV