这是一个简单的问题,但我不太理解。
is
前缀的例子:
private boolean active;
public boolean isActive(){...};//getter
public boolean setActive(boolean b){...};//setter
但是我不明白如何使用以has
为前缀的setter方法。
private boolean hasChildren;
public boolean hasChildren(){...};//getter
public boolean ?(boolean b){...}//setter
setHasChildren
?只要语义明确,它并不是那么重要... - Dici