FANDOM


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 Edit

  • If
  • When
  • then (partner suffix)
  • Or else
  • Otherwise
  • That's what I would do

FDS Edit

Declaration Edit

Else Edit

Ending Edit

Examples Edit

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 Edit


Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.