What to do when I have to use 'isSomething' as name of a Boolean variable?

261 Views Asked by At

The question itself is I have to use 'is' as a name of a Boolean variable for reasons, and I don't know if it's better to find a way to change it's name, or that's not that big problem to use 'isSomething' for the variable and 'isSomething()' for the getter?

1

There are 1 best solutions below

0
On BEST ANSWER

There is no problem in having a field private boolean isSomething; and a getter

public boolean isSomething() {
    return isSomething;
}