Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception

 
naresh babu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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?

Thanks
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
catch(Exception2 e){} ???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic