using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            //#region 
            //string[] names={"Tom","Dick","Harry"};//数组
            //IEnumerable<string> filteredName 
            //    = System.Linq.Enumerable.Where(names,n=>n.Length>=4);
            ////转化为可排序可。。。的IEnumerable<string>类型数据,才能用foreach进行遍历
            //foreach (string n in filteredName)
            //{ Console.WriteLine(n); }
            //Console.ReadKey();
            //#endregion
            #region 查看var类型的名字
            //string[] names ={"Tom","Dick","Harry"};
            var names = new string[]{ "Tom", "Dick", "Harry" };
            Console.WriteLine("names的数据类型是:"+names.GetType().Name);
            var car = new SportCar();
            Console.WriteLine("car的数据类型是"+car.GetType().Name);
            var persons = new List<Person>();//persons的数据类型是List<Person>是列表元素为Person的列表
            Console.WriteLine("persons的数据类型是:"+persons.GetType().Name);
            Console.ReadKey();
            #endregion
        }
        public class Person  { }
        class SportCar { }
    }
}
原文:http://www.cnblogs.com/cnshuji/p/5441924.html