我正在做一个家庭作业问题,我不确定我的代码有什么问题。我收到的作业问题如下:
我收到以下错误消息:
到目前为止我的代码:
public class Person //This is the class
{
String firstName;
String familyName;
boolean isFemale;
Person partner;
}
到目前为止我的方法是:
Person getAngelinaJolie() //This is the method
{
Person person1 = new Person();
person1.firstName = "Angelina";
person1.familyName = "Jolie";
person1.isFemale = true;
person1.partner.firstName = "Brad";
person1.partner.familyName = "Pitt";
return person1;
}