Getter method name for
private boolean mIsLast;
is
public boolean isIsLast() {
return mIsLast;
}
or
public boolean isLast() {
return mIsLast;
}
?
Should use isIsLast() or isLast()?
Getter method name for
private boolean mIsLast;
is
public boolean isIsLast() {
return mIsLast;
}
or
public boolean isLast() {
return mIsLast;
}
?
Should use isIsLast() or isLast()?
For future readers, a better answer to this would be to not use the "is" prefix in the variable name itself. Boolean variables should be named in such a way that prepending "is" would create a natural sounding question. So in OP's example, the field would be called mLast and the getter isLast().
Almost any other answer will say the same thing:
isLast
would be a preferable than isIsLast
if you are dealing with boolean values. It is not a good naming convention to repeat the first syllables of the method.