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 2 people and return the true if Anne is the oldest.
The two people are:
Below is their attempt, but it is throwing a Null Pointer exception. 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.