C Sharp (C#) - Inheritance
Consider the following code:
class Parent {
protected int number = 5;
}
class Child : Parent {
public int GetNumber() {
return number;
}
}
class Program {
static void Main() {
Child c = new Child();
Console.WriteLine(c.GetNumber());
}
}What will be the output when this program runs?
