声纳文档将以下内容显示为 LCOM4 = 1 的重构代码。但在我看来,它应该是 2,因为和之间没有凝聚力getFullName
getFullAddress
。我错过了什么?
public class Client {
public String firstname;
public String lastname;
public Address address;
public String getFullName() {
return firstname + " " + lastname;
}
public String getFullAddress() {
return address.getFullAddress();
}
}