If I have a class named "Parent"
for example. he has a method named "Print".
the class "Kid"
is derived, it has a method named "Print"
, but a new one.
new public void Print;
Let's create an object:
Parent p = new Kid();
If I'll use the method Print with this object's pointer the method will be the father's("Parent") method, not the "Kid".
But when I'm using a virtual method, the method will be the Kid's not the parent.(if the Print was virtual, the print in the "Kid" overrides the method")
Why?