constructor not accepting my information

前端 未结 5 1920
长发绾君心
长发绾君心 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:21

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

    should be

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

    String, String, int and long are expected in this order by your constructor, which is defined by public Person(String nm, String adr, int ag, long phn).

    Allison without (double)quotes is not a String.

提交回复
热议问题