Value type - bool

Download c# eBook

Example

// default value of boolean is false
bool b;
//default value of nullable boolean is null
bool? z;
b = true;
if(b) {
    Console.WriteLine("Boolean has true value");
}

The bool keyword is an alias of System.Boolean. It is used to declare variables to store the Boolean values, true and false.

Stats

Contributors: 2
2015-11-24
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook