class Program
{
static void Main(string[] args)
{
B b = new B();
A a = new B();
Console.Read();
}
}
public class A
{
public A()
{
PrintFields();
}
public virtual void PrintFields()
{
}
}
public class B : A
{
private int x = 1;
private int y;
public B()
{
y = -1;
}
public override void PrintFields()
{
Console.WriteLine($"x={x}, y = {y}");
}
}