Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

java

Name: Anonymous 2010-03-01 7:31

word1 = scan.next();
word2 = scan.next();
word3 = scan.next();
Person [] p = personlist.getPersons();

if (word1.equals("add")) {
    personlist.addPerson(word2,word3);
}
if (word1.equals("show")) {
    for (int i = 0; i < p.length; i++) {
        if (word2.equals(p[i].name)) {
        System.out.println("Navn " + p[i].name);
        System.out.println("Nummer " + p[i].phone);
        System.out.println("Antall venner: " + p[i].friendList.getPersons().length);
        }
    }
/*System.out.println("Navn " + personlist.getPerson(word2).name);
System.out.println("Nummer " + personlist.getPerson(word2).phone);
System.out.println("Antall venner " + personlist.getPerson(word2).friendList.getPersons().length);
*/
}

Why did I have to comment out the last part and use the p array loop. The getPerson() does work, just not in this case, any idea?

Name: Anonymous 2010-03-01 12:36

>>8
DEYRA (Don't explain you 're acronyms).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List