Protected members

Run Settings
LanguageC#
Language Version
Run Command
using System; using System.Collections.Generic; using System.Linq; public class A { protected int x = 123; } public class B : A { } class Program { static void Main() { var a = new A(); var b = new B(); // Error CS1540, because x can only be accessed by // classes derived from A. // a.x = 10; // OK, because this class derives from A. //b.x = 10; //Console.WriteLine(b.x); Console.WriteLine("Hello"); } }
Editor Settings
Theme
Key bindings
Full width
Lines