Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

difference b/w Runtime and compile time exceptions?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
how to know whether an Exception is a Runtime exception or Compile time exception....? How to differentiate between them......?its confusing me a lot.......!!!
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Moving to beginner's.
 
Marshal
Posts: 80871
506
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Ranch Hand
Posts: 710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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.
 
Campbell Ritchie
Marshal
Posts: 80871
506
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Thank you. High fifty-five maybe to the people who compiled that site, then
 
Campbell Ritchie
Marshal
Posts: 80871
506
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Closing as a duplicate of this thread. Read this FAQ.
 
    Bookmark Topic Watch Topic
  • New Topic