• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[B&S] Data.java with RecordNotFoundException

 
Song Choe
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI everyone.

This "must" word is killing me here.
My instruction says,

"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. "

I understand the 1."must have a zero argument constructor.." part, but little confusion with the 2."a second constructor that takes a string that serves as the exception's description".

public RecordNotFoundException(){}
public RecordNotFoundException(String exceptionDescription){...}

My understanding or only idea is that it should have some type of
public RecordNotFoundException(String exceptionDescription, Throwable e){...}

but the description says "a second constructor that takes a string " which is not plural. It sounds like takes one parameter only.

I don't have any idea how to handle the exception if you are getting just a string.

Please help. Thanks.



 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read more carefully. Where does it say you can have only those 2 constructors?

But anyway, if you don't know how to work with exception constructors that take only a String argument you're going to need some more training in Java.
Many constructors take only a String, in fact up until recently no other constructors were around almost anywhere.
[ November 24, 2006: Message edited by: Jeroen T Wenting ]
 
Song Choe
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks JTW for your fast response.
I guess I am making the problem too complex?
Because of the sentence, "a second constructor that takes a string "
it sounded like you can have only two.

again, Thank you and have a nice day.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic