aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes [B&S] Data.java with RecordNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "[B&S] Data.java with RecordNotFoundException" Watch "[B&S] Data.java with RecordNotFoundException" New topic
Author

[B&S] Data.java with RecordNotFoundException

Song Choe
Greenhorn

Joined: Jan 06, 2006
Posts: 8
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.





SCJP 1.4<br />SCJD (work in progress)
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
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 ]

42
Song Choe
Greenhorn

Joined: Jan 06, 2006
Posts: 8
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [B&S] Data.java with RecordNotFoundException
 
Similar Threads
Possible to create exceptions with full stack trace
Exception Requirements - "zero argument constructor" ?
NX: Additional methods in Exceptions
RecordNotFoundException in requirement
NX: Exception handling implementing the DBAccess