h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Abstract -- C# Keywords

Abstract Classes and Abstract Methods in C#.NET

Abstract Classes:

  •   Provide default functionality to its sub classes.
  •   Contain methods with complete implementation, besides abstract methods.
  •   Contains at least one abstract method, then the class must be declared as abstract class.


//Abstract class
    abstract class <Class Name>
    {

        protected float <Var Name>;

        //Abstract methods can have only declarations
        public abstract <DataType> <Method Name>();
         ///Method with Paramenter
        public abstract <DataType> <Method Name>(<DataType> obj);

    }

class  <Class Name(child Class)> : <Class Name(Parent Name)>
{
        public Override <DataType> <Method Name>();
{
/// Write your Code
}

        public Override <DataType> <Method Name>(<DataType> obj);
{
/// Write your Code
}

}