wood burning stoves 2.0*
The moose likes Java in General and the fly likes compile time exception vs runtime exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "compile time exception vs runtime exception" Watch "compile time exception vs runtime exception" New topic
Author

compile time exception vs runtime exception

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi Folks,
wats the differnce between compile time and runtime exception..? please explain the justfied explanation with an example.!!
rajeshd rajd
Greenhorn

Joined: Sep 06, 2011
Posts: 1

friend,

if you written syntax wrongly then compile time error will occured.
Runtime exception will occured in your class file running in jvm.

Saral Saxena wrote:Hi Folks,
wats the differnce between compile time and runtime exception..? please explain the justfied explanation with an example.!!



John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Are you asking the difference between a Checked Exceptions vs Runtime Exceptions? or between Compile time errors and Runtime errors?

I believe in both case you will get useful answers when you search the forum.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38441
    
  23
Welcome to the Ranch rajeshd rajd.

You are right to talk about compile time errors, since exceptions cannot occur at compile time.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

the question is kind of ambiguous but i think Rajeshd answered it. compile time errors are pretty easy to fix. run time exceptions are usually not that hard either, but harder than compile time errors. the worst are the logic errors.


SCJP
Visit my download page
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38441
    
  23
The thing about logic errors is that you may not find out about them until they have done real harm.
 
Consider Paul's rocket mass heater.
 
subject: compile time exception vs runtime exception