using System;
public class Program
{
class B
protected int number = 11;
}
class A : B
public string customValue = null;
public A(){
Console.WriteLine(this.number); // the protected members can be accessed inside the class who make the inheritance.
this.customValue = "My custom value "+ this.number.ToString();
public static void Main()
A a = new A();
Console.WriteLine(a.customValue); // And just the public members can be accessed from outside, when you create an instance of some class.
B b = new B();
//int testB = b.number; //error inaccessable due to its protection level