Table of Contents
Introduction
In Java, Boolean variables don’t strictly follow the noun or noun phrases variable naming approach from the last post.
Java Boolean Variable Names
In general, variables follow noun / noun phrasing naming conventions. For example:
private boolean child = false;
public boolean isChild() {
return child;
}
However, boolean variables may often also be used to describe state, in which case, an adjective would apply:
private boolean running = true;
public boolean isRunning() {
return running;
}
Either way, they should make sense with the getter naming convention, which is to prefix the variable name with is.
Summary
Because boolean variables may store state, they may not strictly adhere to the noun / noun phrase guidance from the prior post.

Leave a comment