码迷,mamicode.com
首页 > Windows程序 > 详细

C# 6.0 新特性

时间:2018-03-21 20:05:19      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:分享图片   bubuko   com   name   ring   gpo   ram   alt   student   

nameof

    class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine(nameof(Student));
            Console.WriteLine(nameof(Student.A));
            Console.WriteLine(nameof(Student.B));
            Console.WriteLine(nameof(Student.C));
            Console.Read();

        }

        public class Student
        {
            public string A => "";
            public int B => 0;
            public DateTime C => DateTime.MinValue;
        }
    }

技术分享图片

 

C# 6.0 新特性

标签:分享图片   bubuko   com   name   ring   gpo   ram   alt   student   

原文地址:https://www.cnblogs.com/lgxlsm/p/8618658.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!