Abstract Method


Applies to classes, methods, properties
An abstract class cannot be instantiated
An abstract class can only be used as a base class
An abstract class can contain abstract methods and properties
An abstract method or property can only be declared in abstract classes
An abstract method or property does not contain any implementation
An abstract method or property cannot be used with static, virtua or override.
Derived classes must implement these abstract methods and properties)

public abstract class Shape 
{
   public abstract string Name()
}

public class Triangle : Shape
{
   public override string Name()
   {
      return "triangle";
   }
}


© 2018 Better Solutions Limited. All Rights Reserved. © 2018 Better Solutions Limited TopPrevNext