This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exceptions

 
Ahmer SSAT-OB
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Can we declare any Exception class STATIC.
2) How can I use return and throw in the same method.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmer

1) Can we declare any Exception class STATIC.


The only way to define any class as a static class is to make it a nested class. When you make a nested class static however, it is the same as creating a new top level class. Why do want to make an Exception class static?

2) How can I use return and throw in the same method.

If you have a method that can throw an exception you can do this:

hope that helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic