I have below member variable mIsMobilePresent
where starting with m
is the convention we follow to identify that it is a member variable.
My question what should be the name of the getter of this variable?
getIsMobilePresent
or getIsMobilePresent
or isMobilePresent
First of all, in Java we usually don't tag member variables with an "m" prefix.
The usual (Java Bean) convention is the variable be named
boolean mobilePresent
and the getter
public boolean isMobilePresent
Alternatively, a has
-prefix can be used
public boolean hasConfiguredMobileConnections;