• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

weird CREATE method !!!

 
M Jay
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys...

In my assignment, it says the following:

// Reads a record from the file. Returns an array where each
// element is a record value.
public String[] read(int recNo) throws RecordNotFoundException;


How can I return an array where each element is a record value when I'm getting the record by it's recNo... i.e. if i want record 8 there's only one record 8 so how can I return more than that???

Cheers in advance
 
Matt Sheehan.
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every record has a value for each field. In my assignment, the fields are:
name, location, size, smoking, rate, date, owner
So an example of a return value for the read method is:
{"Dew Drop Inn", "Xanadu", "4","Y", "$200.00","2003/01/19", "98765432"}

Matt
 
M Jay
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Matt thanks for that,

Each element represents a record


a record is different than a field isn't it?? quite confusing to be honest!! I'd thought that that they would say that each element represents a field in the record
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your mis-reading it:

where each element is a record <b>value</b>


record is the row
record value is the field.
 
M Jay
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok mate thanks for that... I'm getting thicker by the second

Cheers
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it could be worded better...
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic