What is the difference between Error and Exception in Java ?

Error :

It is Generated at compile time and reported by program at compile time only. They are like as missing some of the symbols which are required as per java programming.

Some of the statement which are showing declaration error, missing semicolon (;) error etc.


Exception : 

If the error which is generated at the time of run time which is called Exception. Exception are not the programming error. They generated due to input provided at run time and depends on the inputs only.

If sometime we can see the FileNotFoundException which is generated at run time because compile time doesn't check the content which we provided to program.

Share this

Related Posts

Previous
Next Post »