Share via


true Literal (C# Reference)

Represents the boolean value true.

Example

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

C# Language Specification

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

See Also

Reference

C# Keywords

false (C# Reference)

Concepts

C# Programming Guide

Other Resources

C# Reference