• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About RecordNotFoundException

 
Matheus Mendes
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

On my RecordNotFoundException, may I create a new costructor that receive a boolean type that will indicate if it is a deleted record or not ?

For example, when I call the read(int recNo), it will throw a RecordNotFoundException, on my catch block I'll use one method to verify if it is a deleted record number or a number that never exists.


Example :

1 - record
2 - deleted record
3 - record
4 - EOF

When I call read( 2 ), then I'll get no Record and I will know that may still have records on the File.

The main Question is, May I create this constructor on the Exception ? Or it will cost me points?

On The assignmente Sun 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. "

But doesn't say " must have ONLY " .... I understand that " Must have at least two " .... is this assumption correct?

Thanks
 
Thiago Melo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matheus,
your instructions doesn't say this too? "Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file" If yes, i guess you can't use this class for other purpose that specified early.
 
Matheus Mendes
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thiago Melo wrote:Matheus,
your instructions doesn't say this too? "Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file" If yes, i guess you can't use this class for other purpose that specified early.


yes, it say it too. But it only saids that the method must Throw the exception, and doesn't say nothing about the Exception's structure.

Well somebody else had this question ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic