public Client(String name,String company,Communication com,Address add){
this.name=name;
this.company=company;
this.com=com;
this.add=add;
printClientInfo();
printClientInfo在哪里定义的,把Client类的完整代码发出来看看。
需要现在类中声明 printClientInfo();函数,然后添加printClientInfo();函数的实现。参考如下:
public class Client {
private String name;
private String company;
private String com;
private String add;
//带参构造函数
Client(String name, String company, Communication com, Address add) {
this.name = name;
this.company = company;
this.com = com;
this.add = add;
printClientInfo();
}
//声明方法
public void printClientInfo() {
//这里添加实现的内容
System.out.println("调用printClientInfo()方法");
}
//其它代码
}