Logical Operators
The If-Else Statement
Tip
Curly braces are not required for one-line if-else statements
Switch Statements
Tip
Java will jump to the first matching case, and will execute blocks after matching case. To prevent execution of following cases, use break
at the end of the block.
Equality
The ==
sign is the default way to check for equality. This is equivalent to the .equals(obj)
method, which is built-in to all classes (all objects extend the Object
superclass)