bool

noun

say it: “BOOL” /buːl/

The C# type for a value that is either true or false.

What is bool in C#?

bool — The C# type for a value that is either true or false. Comparisons give you a bool, and if statements and loops decide what to do with one.

bool isInStock = true;
bool isExpensive = 24.50m > 20m;
Console.WriteLine(isExpensive); // True

In a sentence

  • “I stored whether the book was in stock in a bool called isInStock.”

Level: Novice · More C# terms at this level

Updated