C#基础[8] 属性
2021-05-14 17:29
标签:read ons new protect threading pac get bsp system protected 受保护的:可以在当前类的内部以及该类的子类中访问。 C#基础[8] 属性 标签:read ons new protect threading pac get bsp system 原文地址:http://www.cnblogs.com/lolitagis/p/7517828.htmlusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace protected访问修饰符
{
class Program
{
static void Main(string[] args)
{
//public private
Person p = new Person();
}
}
public class Person
{
protected string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
}
public class Student : Person
{
public void Test()
{
}
}
}