Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About using Application Exceptions in a Project

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi ,

My appolizes if it is not the right forum .

Please let me know this :

whenever we need to define any Application Exceptions we just do like this :

For Example if there is InsufficientBalanaceException like this .

public class InsufficientBalanaceException extends Exception
{
InsufficientBalanaceException ()
{
}
}

But please let me know whether these ApplicationExceptions will be Exception or RuntimeException.
sorry if is a dumb question .
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am sorry .Its a dumb question actually .
 
Rituraj Jain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think it will be a compile time exception...compiler will flag it...........why don't you subclass RuntimeException class if you want an run time exception

read this article Read It
 
Campbell Ritchie
Sheriff
Pie
Posts: 49391
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The hardest part of creating Exceptions is deciding which other class it ought to extend.

You usually need to overload the constructor when subclassing Exceptions. In 99% of occasions, you need do nothing else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic