- Decisions in java are done using if statements.
- If statements are known as control statements
- If statement syntax is always if (<condition>) followed by a true block of code.
- You can add a optional else block to handle the false outcome.
- Conditions must evaluate to true or false and are known as expressions.
- You can use <, >, <=, >= as operators
- == and != represent equals and not equals respectively.
- You can chain if statements together using else if.
- You can nest if statements to further refine truth.
- Truth trees can be used to help you understand how a if statement can be structured.
- Logical operators allow you to chain together conditions.
- AND is known as conjunction and is represented with &&
- OR is known as disjunction and is represented with ||
- NOT is known as negation and is represented with !
- Logical operators only deal with boolean expressions.
- Truth tables show how AND, OR and NOT work. Learn them!