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