0
/ 50
For the question below, assume the following implementation of a Person class:
public class Person { private int age; private String...
For the question below, assume the following implementation of a Person class:
public class Person {
private int age;
private String name;
private String grade;
public Person(int a, String n, String gr) {
age = a;
name = n;
grade = gr;
}
public int getAge() {
return age;
}
public String getName() {
return name;
}
public String getGrade() {
return grade;
}
}
Your coworker wanted to create a method that would create 3 people and return the true if Anne is the oldest.
The three people are:
Below is their attempt, but a null pointer exception is still being thrown! Fix the issue with the code and think about how you would explain the problem to your coworker.
Your feedback will appear here when you check your answer.