In computer programming, a statement is a specific instruction in the source code of a program. It is the most basic piece of information in a program, and cannot be separated into smaller instructions. A statement is different from a function or method in that both functions and methods are references to a group of statements, while statements are the instructions themselves.

Types of Statements Edit

There are several kinds of statements; some tell the computer what to do based on conditions, while others instruct the computer to create new objects, and still others help with exception handling.

Control Flow Edit

Control flow statements instruct the computer what to do based on criteria. Examples of this are the if-then-else statement and the ternary operator.

Looping Edit

Loop statements continuously execute the code inside of their block until certain requirements are met. Examples of these are the while loop and the for loop.

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.