Implementierungsvererbung

class A     { void P () { WriteLine ("A"); } }
class B : A { void P () { WriteLine ("B"); } }
Variable mit statischem Typ A, dynamischem Typ B:
A x = new B (); x.P(); // druckt "A" oder "B"?

Möglichkeiten:



Johannes Waldmann 2007-06-21