• Post Reply Bookmark Topic Watch Topic
  • New Topic

What are the ways to Create UserException Classes  RSS feed

 
Deepa Pillai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was asked a question in interview "What are the ways UserException class can be created?"
The answer is by extending "Exception" class

But ,It was told to be a partial answers as other way to create userexception class is through throwable class.

Is this a expected answers?
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Their answer is wrong, since their question was: how to create a user exception class. For it to be an exception class, it needs to extend Exception (or any subclass).

If a class extends Throwable or a subclass that is not Exception, then it is not an exception - it's a throwable or error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!