运行结果及报错内容
package practice;
public class Tenant {
private String name;
private String telephone;
private int lengthOfTenure;
public Tenant(String initialName,String initialTelephone,int initialLengthOfTenure)
{
name=initialName;
telephone=initialTelephone;
lengthOfTenure=initialLengthOfTenure;
}
public String getName()
{
return name;
}
public String getTelephone()
{
return telephone;
}
public int getLengthOfTenure()
{
return lengthOfTenure();
}
public static void main(String[] args) {
Tenant yeszhang = new Tenant("zyh","135",100);
System.out.println(yeszhang);
}
}