Java编写为什么总是出现错误?
1个回答
展开全部
你的构造方法的参数对不上
class Namecard
private String name;
private String address;
private Phone data;
public Namecard(String n,String a,String str3,String str4)
name = n;
address = a;
data = new Phone(str3,str4);
class Phone
private String company;
private String cell;
Phone(String s1, String s2)
company = s1;cell = s2
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询