My accessor method returns null in Java but compiles without errors : <p>This is for a homework assignment and I'm totally stumped on this one.</p>

<pre><code>public class Person {
String name;
int age;

public Person(String myName,int myAge) {
   myName = name;
   myAge = age;
}

public int getAge() {
    return age;
}

public String getName() {
}

public void setAge(int newAge) {
   age = newAge;
}

public void printDetails() {
    System.out.println("The name of this person is " + getName());
}

public static void main (String[] args ) {
    Person Eliza = new Person("Eliza", 66);
    Eliza.printDetails();
}
}
</code></pre>

<p>This returns:</p>

<pre><code>The name of this person is null
</code></pre>

<p>Hopefully I've missed something really obvious any comments are appreciated.</p>
