• 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
Posts: 12059
232
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!