A boolean literal is represented by one of two keywords–either true or false. A boolean literal is always of type bool.
Here are a few examples:
1
2
3
4
5
| bool happy = true ; bool rich = false ; if (happy == true ) Console.WriteLine( "Happy guy" ); File.Copy( @"C:\From.txt" , @"C:\To.txt" , false ); // don't overwrite while ( true ) Console.WriteLine( "Loop forever" ); |