Women in Technology

Hear us Roar



Article:
  Java Web Development with Stripes
Subject:   Code typo?
Date:   2007-01-25 11:08:32
From:   garthabrindoid
Is the code for HelloWorldAction in the first code snippet correct? I'm confused about how this part in particular:



private Person person;


...


public void setPerson(String person) {this.person = person;}
public String getPerson() { return person;}


Judging by the setter and getter, person should be a String and not a Person, right? Or are the getter and Setter wrong?

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Code typo?
    2007-01-25 11:41:14  mjeagle [View]

    Sorry, the field is of type Person and the accessors should look like this:


    public void setPerson(Person person) {this.person = person;}

    public Person getPerson() { return person;}

    Sorry for the confusion.



    Mark