Alıntı:
>> interface D {
> int foo();
> }
>
> class A : D {
> int foo() { return 1; }
> }
>
> class B : A, D {
> int foo() { return 2; }
> }
>
> ...
>
> B b = new B();
> b.foo(); // returns 2
> D d = cast(D) b;
> d.foo(); // returns 2
> A a = cast(A) b;
> D d2 = cast(D) a;
> d2.foo(); // returns 2, even though it is A's D, not B's D
> ```
>
Olaya bakın...:)
--
[ Bu gönderi, <http://ddili.org/forum>'dan dönüştürülmüştür. ]