C# GetType获取对象的数据类型

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A004_GetType获取对象的数据类型
{
    class GetTypeTest
    {
        static void Main()
        {
          
            int radius = 3;
            Console.WriteLine("Area = {0}", radius * radius * Math.PI);
            Console.WriteLine("The type is {0}",
                              (radius * radius * Math.PI).GetType());
            Console.WriteLine("查询数据类型{0}",
                              ("sdfadsf").GetType()  );
            Console.ReadLine();
        }
    }

    //int i=3
    /*
    Output:
    Area = 28.2743338823081
    The type is System.Double
    */
}


 

你可能感兴趣的:(C#,C#,后端)