my dog learned polymorphism
The moose likes Beginning Java and the fly likes nested exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "nested exception" Watch "nested exception" New topic

nested exception

rakesh kadulkar
Ranch Hand

Joined: Jul 24, 2008
Posts: 115

I dont understand that why there is a nested exception in the programming.


Why this is done in the code.

Rakesh Kadulkar
Chinna Eranna
Ranch Hand

Joined: Dec 08, 2009
Posts: 174

There will be cases where.. Applications will have there own specific exceptions defined.

In that case.. they catch the predefined exception, create their own exception and throw it back.

- Chinna
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45364
Welcome to JavaRanch

In most cases where you throw a new Exception, you can pass the old Exception to its constructor and both Exceptions can be passed together.
I agree. Here's the link:
subject: nested exception
It's not a secret anymore!