*
The moose likes Beginning Java and the fly likes difference b/w Runtime and compile time exceptions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

difference b/w Runtime and compile time exceptions?

Naveen Megharaj
Ranch Hand

Joined: Feb 13, 2009
Posts: 39
how to know whether an Exception is a Runtime exception or Compile time exception....? How to differentiate between them......?its confusing me a lot.......!!!
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
If its a subclass of java.lang.RuntimeException, then it means its RuntimeException. Having said that, you don't usually need to catch runtime exceptions, they wouldn't complain either. Whereas regular exceptions, you need to handle gracefully. You can refer the docs to see all the pre-defined RuntimeExceptions in Java such as, ArithmeticException, and the infamous NullPointerException.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Moving to beginner's.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37953
    
  22
There is no such thing as a compile time exception. All exceptions occur at runtime. Compile time errors are different. There is a website about errors here.
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
Campbell Ritchie wrote:There is no such thing as a compile time exception. All exceptions occur at runtime. Compile time errors are different. There is a website about errors here.


Nice site! If you were here, I'd give you a high five. Since you are not, I will do the distance high five in my mind.


SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37953
    
  22
Thank you. High fifty-five maybe to the people who compiled that site, then
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37953
    
  22
Closing as a duplicate of this thread. Read this FAQ.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference b/w Runtime and compile time exceptions?
 
Similar Threads
Exceptions in JSP
difference b/w Runtime and compile time exceptions?
Compile time & runtime exceptions
NumberFormatException
Exception