“Or” truth table
T || T is T
T || F is T
F || T is T
F || F is F
“And” truth table
T && T is T
T && F is F
F && T is F
F && F is F
6 relational operators
== != > >= =
How do you use == with String?
variable1.equals(variable2);
Or
variable1.equalsIgnoreCase(variable2);
Decimal format money?
DecimalFormat money = new DecimalFormat("$0.00");
System.out.println(money.format(3.15));Logical operators?
&& || !
If statements format
If(test condition)
{
block of code;
}
else if(blah)
{
meow;
}
else
{
codes;
}a=3 vs a==3
a=3 is an assignment statement
a==3 is a Boolean test condition (used with if statements)
What is a Boolean statement
Fact that can be proven true or false