• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on implementing interface method

 
Ed Ward
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings all!
I've just donwloaded the Urlybird assignment and have read through the instructions just once so far, but was wondering if I'm understanding this correctly.
The interface I must implement has the following method:


Now my question. Given that the method takes a recNo parameter and the first comment states that the method reads a record from the file, it seems that the second comment contradicts that by stateing the method returns an array where each element is a record.
It seems like if the method takes recNo and reads a record than each element in the returned String[] would be a field from that record, as opposed to each element being an entire record.

Am I missing the point?


Thanks, Ed.
 
Roel De Nijs
Sheriff
Posts: 9795
101
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"where each element is a record value", so "a record value" not "a record" (like in the 1st sentence: "Reads a record from the file.". Your understanding is correct: each element in the array corresponds with a field from the record you have to read (otherwise it would make no sense at all)
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Ed!

Given that the method takes a recNo parameter and the first comment states that the method reads a record from the file, it seems that the second comment contradicts that by stateing the method returns an array where each element is a record.


Well champ, the thing is that, given the record number, you have to return a String array where each position in the String array corresponds to a field of the record. You can return the fields in the same order that they appear in the database schema.
 
Ed Ward
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
That's what I had in mind, but the wording threw me off a little.
 
David Byron
Rancher
Posts: 175
Clojure Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ed Ward wrote:

It seems like if ... each element in the returned String[] would be a field from that record, as opposed to each element being an entire record.

"record value" means "a field from that record"
"record value" does not mean "a value of type 'record'"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic