Correct the following erroneous definition of method getAge()
public void getAge()
{
return age;
}
Paste your answer in here:
public int getAge(int age)
{
return age;
}
Mark: 0 out of 1
Comments:
* Test 1 (0.0 out of 1)
Person.java:15: getAge(int) in Person cannot be applied to ()
String s = (p.getAge() == 16 ? "getAge() Correct" : "getAge() not Correct");
^
1 error
The output should have been:
getAge() Correct
This is what was actually produced:
Exception in thread "main" java.lang.NoClassDefFoundError: Person
instead of (int age) does it want me to replace it with a String?