char type

char(System.Char) type from C# uses two bytes to store unicode character.

C# uses single quote to wrap char type literal.

The following code stores character a to char type variable:


using System;

class Program
{
    static void Main(string[] args)
    {
        char ch = 'a';
        Console.WriteLine(ch);
    }
}

The output:


a
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.