This question has already been answered:
There is an interface ITransport , with a description of the void Show(); method void Show();
This interface implements an abstract class.
abstract class Naz_Transport:ITransport and, accordingly, the method public void Show(){} .
There is a class that inherits from the above class.
class Avtobus:Naz_Transport and it also has a method
new public void Show() { base.Show(); + еще некоторые данные, принадлежащие этому классу } The problem is the following, in Maine I create an array of objects
ITransport[] arr = { new Avtobus(тут данные для конструктора) }; And when I try to call the arr[0].Show(); for some reason, the method from the Naz_Transport class Naz_Transport , although I need the method from the Avtobus class to Avtobus .
What is wrong doing? Thank you in advance.
base.Show();- Grundynew public- useoverrideand everything will work - Grundy