Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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 following sections in the C# Language Specification:

  • 2.4.4.1 Boolean literals

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.