protected
受保护的:可以在当前类的内部以及该类的子类中可以访问。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace protected访问修饰符 { class Program { static void Main(string[] args) { //protected public private Person p = new Person(); p.Name = "2"; } } public class Person { protected string _name; public string Name { get { return _name; } set { _name = value; } } } public class Student:Person { public void Test() { _name = "1"; } } }