Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructors of unimplemented Exceptions

 
Zafer Abu saeed
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package. Each must have a zero argument constructor and a second constructor that takes a String that serves as the exception's description.


Does this mean that only two constructors (zero argument, and String) are allowed?
Starting JDK 1.4 there is a very useful feature of wrapping exceptions using the Exception(Throwable cause) constructor. Can we use (implement) this constructor as well?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12012
216
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zafer,

That instruction tells you the minimum number and type of constructors that your Exceptions must implement. You are free to implement any additional constructors you like.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic