• Post Reply 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exceptions

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! friends,
Could u please explain me - what is the difference between Checked Exceptions and java.lang.RuntimeException
Thanks in advance
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The set of checked exceptions is a subset of exceptions in java. Whenever you write code which can potentially throw one of these exceptions, you have to explicitly enclose that code in a try block and catch the checked exception. Or your method must explicitly declare it using a throws clause.
Good question. This is an important concept in java.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anil,
The JLS calls any exception that derives from the class Error or the class RuntimeException an unchecked exception.All other exceptions r called checked exceptions.
It is the checked exceptions that r the ones u should deal with either by handling them or declaring in throws clause that they r not handled. Unchecked exceptions r either beyond ur control(Error) or result from conditions that u should not have allowed in the first place while programming(i.e., they r user mistakes while programming)(RuntimeException).
Unchecked Exceptions r called so because the compiler does not check to see if a method handles them, or throws them.
 
mamilla anil kumar reddy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thankq "thomas" and "kiran" for ur kind reply...

 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic