Why I can't access child field when use inheritance in C#?

Advertisements using System; class MyClass { public static void Main() { Student a = new Student(); Person y = new Gamer(); Console.WriteLine(a.X); Console.WriteLine(y.X); <=== Error here } } abstract class Person { public abstract void Display(); } class Student : Person { public int X { get; set; } = 1; public override void Display()… Read More Why I can't access child field when use inheritance in C#?

How to get user input and pass it as an argument in function inside classes in python

Advertisements I am new to python and I am trying to find a efficient way to get user input for the following and pass them as arguments in function while using classes. I am new to oops and I am finding it hard to get user input from user while implementing classes and objects Can… Read More How to get user input and pass it as an argument in function inside classes in python