例如。
boolean isCurrent = false;
你给它的getter和setter起什么名字?
最佳答案
假设你有
boolean active;
访问器方法是
public boolean isActive(){return this.active;}
public void setActive(boolean active){this.active = active;}
另见
关于java - 对于 boolean 字段,它的 getter/setter 的命名约定是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5322648/