Fiveable
Fiveable

boolean

Definition

A boolean is a data type that can only have two possible values: true or false. It is often used in programming to make decisions and control the flow of a program.

Analogy

Think of a light switch that can be either on (true) or off (false). Just like how you use a light switch to determine whether the lights are on or off, a boolean variable helps programmers determine whether certain conditions are true or false.

Related terms

Condition: A condition is an expression that evaluates to either true or false. It is used in programming to make decisions and control the flow of code.

Boolean operators: Boolean operators are symbols such as AND, OR, and NOT that allow you to combine multiple conditions together in order to create more complex expressions.

Control flow: Control flow refers to the order in which statements are executed in a program. Booleans play a crucial role in controlling the flow of code by determining which statements should be executed based on certain conditions.

"boolean" appears in:

Practice Questions (9)

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.