public void TestMethod1() { Caller c = new NewCaller(); Shape r = new Rectangle(10, 7); Shape t = new Triangle(10, 5); c.CallArea(r); c.CallArea(t); }
public void TestMethod1() { Caller c = new NewCaller(); Shape r = new Rectangle(10, 7); Shape t = new Triangle(10, 5); c.CallArea(r); c.CallArea(t); // without dispatching r.area((dynamic)c); t.area(c); }
public override int area(NewCaller c) { c.PrintMe(); Trace.WriteLine("New Rectangle class area :"); return(width * height); }
public virtual int area(NewCaller c) { Trace.WriteLine("New Parent class area :"); return(0); }