constructor not accepting my information

前端 未结 5 1923
长发绾君心
长发绾君心 2021-01-28 08:32

so the constuctor is saying ) expected, error not a statement and ; expected

    Person num1, num2, num3;
    num1=new Person(Allison, 6600 Crescent Ave, 32, 902         


        
5条回答
  •  忘了有多久
    2021-01-28 09:22

    You are not passing a string for Name and Address to your constructor, try changing

    num1=new Person(Allison, 6600 Crescent Ave, 32, 9024231421);
    

    to

    num1=new Person("Allison", "6600 Crescent Ave", 32, 9024231421);
    

提交回复
热议问题