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


naresh babu

Joined: Feb 12, 2002
Posts: 12
I had a question in exception:
public class exception1 extends Exception{}

public class exception2 extends exception1{}
I want client to catch only exception2, but
not exception1.Any ideas?

Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
catch(Exception2 e){} ???
I agree. Here's the link:
subject: Exception
It's not a secret anymore!