java - 对于 boolean 字段,它的 getter/setter 的命名约定是什么?

标签 java coding-style naming-conventions javabeans

例如。

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/

相关文章:

java - tomcat启动但没有监听任何端口

java - 变量必须是 'temporary' 才被视为 'throwaway' 吗?

url - URL 中 'slug' 的词源是什么?

ios - 使用 Setter 和 Getter 方法与直接操作相比的好处

haskell - 良好的 Haskell 编码标准

用于销毁资源的 Powershell 动词

Angular 模块名称单数或复数

java - 如何使用 CLI 将模块添加到 Wildfly

java - 使用对先前标记的引用以及与某个类的子类型对应的子项来解析 XML

java - 是否可以在 Spring Boot 中将 MongoDb 和 PostgreSql 用于同一模型?