An if statement is the most basic of branching statements. It simply allows a block of code to be run if and only if a given condition is true.
Related Phrases[]
If
When
then
(partner suffix)Or else
Otherwise
That's what I would do
FDS[]
Declaration[]
- Exactly one of:
Else[]
- Zero or one of:
Ending[]
- Exactly one of:
That's what I would do
<punctuation>
Examples[]
A simple single conditional:
Did you know that
Pinkie Pie
likes
the number
15
?
When
Pinkie Pie
was more than
1
,
I said
"Too many Pinkie Pies!"
!
That's what I would do
.
Java Equivalent:
int Pinkie_Pie = 15;
if (Pinkie_Pie > 1){ System.out.println("Too many Pinkie Pies!");
}
See Also[]
- Conditional Statements
- Switch
Phrases (list) | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|