当前位置:首页 > C#教程 > C#进阶

C#访问修饰符

using System;
namespace MySpecifiers
{
   class Demo
   {
      protected string name = "Website";
      protected void Display(string str)
      {
         Console.WriteLine("Tabs: " + str);
      }
   }
   class Test : Demo
   {
      static void Main(string[] args)
      {
         Test t = new Test();
         Console.WriteLine("Details: " + t.name);
         t.Display("Product");
         t.Display("Services");
         t.Display("Tools");
         t.Display("Plugins");
      }
   }
}

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!