I have an Employee class. It needs a boolean flag to tell if this employee is a manager.
From this question For a boolean field, what is the naming convention for its getter/setter?
I understand that the naming conversion is to name the variable as X and the getter as isX. So my Employee class would be like this
class Employee {
boolean manager;
boolean isManager(){
return this.manager;
}
}
But the name manager is confusing to me. The word manager is a noun, not an adjective, like active, current, open in the above question. manager could be a boolean flag or a manager object. Furthermore, if I do want a member variable for the manager in the Employee class, the manager variable name is already taken for the flag.
class Employee {
boolean manager;
boolean isManager(){
return this.manager;
}
//Employee manager; //don't know how to name this
}
Is there another way to name the boolean manager flag in this case? Thanks