If not, what's his purpose?
example:
abstract class Shape { public abstract int Area(); } class Square : Shape { public int Lato; public Square(int iLato) { this.Lato = iLato; } public override int Area() { return this.Lato * this.Lato; } } class Program { static void Main(string[] args) { Shape A = new Square(10); Console.WriteLine("There you go: {0}", A.Area()); Console.ReadLine(); } } }
No comments:
Post a Comment