It's not a secret anymore!
The moose likes Beginning Java and the fly likes Throwable and error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Throwable and error" Watch "Throwable and error" New topic

Throwable and error

jai gurudev

Joined: May 28, 2004
Posts: 20

can we catch Throwable and Error in Catch Block like

Catch(Throwable e) and Catch(Error e)

give some examples


Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131
Hi Jai,

Why don't you try it yourself? You know what an Error or a
Throwable is, you probably know how to use exceptions, so
why don't you just put a few of lines together, run javac,
then java, and see?!?

I mean, that's the way how you can learn the most.


Get a better web browser:<br /><a href="" target="_blank" rel="nofollow"></a>
Kj Reddy
Ranch Hand

Joined: Sep 20, 2003
Posts: 1704
I agree with Mr. Petr Thats true. You can learn more things by trying your own.

You can catch everything which are all subclasses of Throwable including Throwable. So Mr Jai why dont you test my statement and tell me whether i right or wrong?

Vijayendra V Rao
Ranch Hand

Joined: Jul 04, 2004
Posts: 195
Originally posted by jai gurudev:

give some examples

Write your own examples and test them. The best way to learn is

Vijayendra <br /> <br />"The harder you train in peace, the lesser you bleed in war"
wood burning stoves
subject: Throwable and error
It's not a secret anymore!