Two Laptop Bag*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Question on implementing interface method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question on implementing interface method" Watch "Question on implementing interface method" New topic
Author

Question on implementing interface method

Ed Ward
Ranch Hand

Joined: Jan 30, 2006
Posts: 147
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
Bartender

Joined: Jul 19, 2004
Posts: 5216
    
  12

"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)

SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

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.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Ed Ward
Ranch Hand

Joined: Jan 30, 2006
Posts: 147
Thanks!
That's what I had in mind, but the wording threw me off a little.
David Byron
Rancher

Joined: Jan 20, 2009
Posts: 172

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'"


SCJD 6, OCPJP7, Baroque Potion, G+
 
 
subject: Question on implementing interface method