• 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

exception relatead

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i have two classes A,B.
class A extending Exception class and class B extending the RuntimeException ,what is the difference between these two.

cheers,
babu.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A is a "checked exception", B is an "unchecked exception". Methods that throw A must declare that they do so; methods that throw B are not required to declare anything. If you call a method that declares that it throws a checked exception, you must catch it, or in turn, declare that your calling method also throws this exception.
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Babu Lal it seems that you are not practicing the codes this is a request pls check ownself. It seems that you are not working in that. This will be usefull for us if you first scratch yourself.

Cheers Babu Lal Ji
 
Shaan Shar
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although I think Ernest Friedman-Hill has given a satisfactory solution for your problem. This is the basic difference between Checked Execption and Unchecked Execption if you are handling Checked Execption then you have to handle it.

Hopes it solve your confusion.
Cheers Babu Lal Ji
Be Happy Babu Lal Ji
 
Shaan Shar
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also please specify the Problem header correctly. As you have written Exception Related now pls specify either Diff between Checked and Unchecked Exceptions.
CHeers Babu Lal ji.
Don't Worry Babu Lal Ji
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic