Anonymous type

Anonymous type is created with var and new.


using System;

class Test
{
    static void Main()
    {
        var person = new { Name = "J" };

        Console.WriteLine(person.Name);
    }
}

The output:


J
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.