#21 – Boolean Literals
July 8, 2010 Leave a comment
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:
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");