Solved the problem of inheritance on: http://skills.itvdn.com/
Specifically, the condition is:
After declaring the Base class, create a Derived class inherited from Base so that its field1 defaults to “derived.f1” and field2 to the value “base.f2”.
It would seem nothing complicated, just added the constructor and assigned the necessary values ​​in the fields.
using System; namespace Less03_task01 { class Program { static void Main( string[] args ) { Derived inst = new Derived(); Console.WriteLine("f1 = {0}\tf2 = {1}", inst.field1, inst.field2); Console.ReadKey(); } } class Base { public string field1 = "base.f1"; public string field2 = "base.f2"; } class Derived : Base { public Derived() { field1 = "derived.f1"; field2 = "base.f2"; } } } But *** that there, the problem is not solved correctly. Climbed into the tips there it was written:
"Or you can override the field1 with a new field with the same name (use the keyword new)."
What does this mean and how to use it in solving the problem?