Use nameof on various parts of a class - CSharp Custom Type

CSharp examples for Custom Type:nameof

Description

Use nameof on various parts of a class

Demo Code

using System;/*from www .  j  a v  a 2  s .  co  m*/
using System.ComponentModel;
class SimpleNameof
{
   private string field;
   static void Main(string[] args)
   {
      Console.WriteLine(nameof(SimpleNameof));
      Console.WriteLine(nameof(Main));
      Console.WriteLine(nameof(args));
      Console.WriteLine(nameof(field));
   }
}

Related Tutorials