What am I doing wrong? (problem with classes)

Having the same function name “Talk” doesn’t magically link together the function calls between base and derived types- in order for that to happen, you need to define Talk in the Animal class as virtual or abstract- virtual meaning it’s possible for derived types to override that function, and abstract meaning derived types must override that function. You then have to actually override this function in derived types in order for the behaviour to be any different.

In other words, when a Dog is referenced as an Animal, you lose access to all fields, properties, and methods specific to Dogs until if/when you cast that object back into a Dog, with the notable exception of properties and methods that are virtual/abstract and then overridden.

Also, please use code tags when posting code here, as shown in the sticky thread at the top of every forum. It’s very important.