Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

true Literal (C# Reference)

Represents the boolean value true.

class TrueTest
{
    static void Main() 
    {
        bool a = true;
        Console.WriteLine( a ? "yes" : "no" );
    }
}
/*
Output:
yes
*/

For more information, see the C# Language Specification. The language specification is the definitive source for C# syntax and usage.

Show:
© 2015 Microsoft