This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes delete operation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "delete operation" Watch "delete operation" New topic

delete operation

K Madan

Joined: Apr 08, 2004
Posts: 10
// Deletes a record, making the record number and associated disk
// storage available for reuse.

// Throws SecurityException if the record is locked with a cookie
// other than lockCookie.
public void deleteRecord(long recNo, long lockCookie)
throws RecordNotFoundException, SecurityException;

Data section.
Repeat to end of file: 1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record

This text is from B&S assgnment can anyone please explain what does delete operation actually does :-
1. sets a (delete)byte to 1 in the file for the record
2. removes it from the file (as in the interface doc it says
associated disk storage available for reuse.

anyone knows this?
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
I means that the record should be marked as deleted, and in future add operation you can use the same space to enter the new record.
Basically, it says that when you add a new record, you should find a deleted record first then overwirte it.

SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
K Madan

Joined: Apr 08, 2004
Posts: 10
Thanks Hanna
it makes sense now !
I agree. Here's the link:
subject: delete operation
It's not a secret anymore!