A boolean variable holds true or false, which means you can use it directly as an if condition without any comparison operator.
boolean isLoggedIn = true;
if (isLoggedIn) {
System.out.println("Welcome back");
}
Writing if (isLoggedIn) is the same as if (isLoggedIn == true), but shorter and easier to read. Most Java developers prefer the shorter form.
To check for false, use the NOT operator !:
if (!isLoggedIn) {
System.out.println("Please log in");
}
Name your booleans so they read like English. isReady, hasPermission, canEdit. When you see if (hasPermission), it reads as "if has permission," which is clear without comments.