因此,构造函数在说)预期,错误不是陈述,并且; 预期
Person num1, num2, num3; num1=new Person(Allison, 6600 Crescent Ave, 32, 9024231421); num2=new Person(George, 5251 Lakewood St, 24, 9024489216); num3=new Person(Michael, 2429 Inglis St, 56, 9024212345);
对象类
public Person() { } //constructor allows programmer to define variable values in demo class public Person(String nm, String adr, int ag, long phn) { name=nm; address=adr; age=ag; phoneNumber=phn; }
num1=new Person(Allison, 6600 Crescent Ave, 32, 9024231421);
应该
num1=new Person("Allison", "6600 Crescent Ave", 32, 9024231421);
您的构造函数(由定义)应按此顺序要求String,String,int和long public Person(String nm, String adr, int ag, long phn)。
public Person(String nm, String adr, int ag, long phn)
不带双引号的Allison不是字符串。