 static readonly ArithmeticOperator Plus = new PlusOperator();
    public static readonly ArithmeticOperator Minus = new MinusOperator();

    public abstract int Apply(int x, int y);

    private ArithmeticOperator() {}

    private class PlusOperator : ArithmeticOperator
    {
        public override int Apply(int x, int y)
        {
            return x + y;
        }
    }

    private class MinusOperator : ArithmeticOperator
    {
        public override int Apply(int x, int y)
        {
            return x - y;
        }
    }
}

In this respect, an abstract private method/property could make sense - it could be accessed by the base class but provided by the derived classes within the same class's program text. However, it's prohibited by the specification. Usually, protected abstract members would solve the same problem - but not quite always.

A:

Good question. Here's why Abstract classes need constructors even though they cannot be instantited.
In any Object oriented language like C#, object construction is an hierarchical process. Look at the code below. When you instantiate any object of type DerivedClass, it must construct the base object first before creating the object of typeof DerivedClass. Here the base class may or may not be an Abstract class. But even when you instantiate an object of a concrete type derived from an abstract class it will still need to call the constructor of the Base class before the object of DerivedClass type is created, hence you always need a constructor for Abstract class. If you have not added any constructor, C# compiler will automatically add a public parameterless constructor to the class in the generated MSIL. 
public class BaseClass
{
    public BaseClass() 
    {
        Console.WriteLine("BaseClass constructor called..");
    }
}

public class DerivedClass : BaseClass
{
    public DerivedClass()
    {
        Console.WriteLine("DerivedClass constructor called..");
    }
}

DerivedClass obj = new DerivedClass();

//Output
//BaseClass constructor called..
//DerivedClass constructor called..

PS: Assuming, If Abstract base classes
  are not allowed to have constructors
  because they need not be instantiated,
  the whole fundamentals of the object
  oriented programming will go on
static readonly ArithmeticOperator Plus = new PlusOperator (); 
     public static readonly ArithmeticOperator Minus = new MinusOperator (); 

     public abstract int Apply(int ten, int y); 

     individual ArithmeticOperator () { } 

     private class PlusOperator: ArithmeticOperator 
     { 
         public override int Apply(int adam, int y) 
         { 
             return x + y; 
         } 
     } 

     private course MinusOperator: ArithmeticOperator 
     { 
         public override int Apply(int x, int y) 
         { 
             return x - y; 
         } 
     } 
 } 

 In this esteem, an abstract private method / place could make sense - it could be accessed by the base course but provided by the derived class within the same class's plan text. However, it's prohibited by the specification. normally, protected abstract members would resolve the same trouble - but not quite always. 

 A: 

 adept question. Here's why Abstract classes need builder even though they cannot be instantited. 
 In any Object oriented language like C #, object construction is an hierarchical procedure. Look at the code below. When you instantiate any object of type DerivedClass, it must construct the base object first before creating the object of typeof DerivedClass. Here the foundation class may or may not be an Abstract class. But even when you instantiate an aim of a concrete character derived from an abstract class it will still need to shout the builder of the Base class before the object of DerivedClass type is produce, hence you always need a constructor for Abstract class. If you have not add any constructor, C # compiler will automatically add a public parameterless builder to the class in the generated MSIL. 
 public course BaseClass 
 { 
     public BaseClass () 
     { 
         Console. WriteLine("BaseClass constructor called.. "); 
     } 
 } 

 public class DerivedClass: BaseClass 
 { 
     public DerivedClass () 
     { 
         Console. WriteLine("DerivedClass constructor called.. "); 
     } 
 } 

 DerivedClass obj = new DerivedClass (); 

 //Output 
 //BaseClass builder called.. 
 //DerivedClass constructor called.. 

 PS: Assuming, If Abstract base classes 
   are not allowed to have constructors 
   because they need not be instantiate, 
   the whole fundamental of the object 
   oriented scheduling will go on
 stwtic readonly ArithmeticUperator Plus = uww PluvOperafor();
    pjblic static readonly ArithmxticIperaujr Minus = new MinurOperator();

    publuc austract int Applb(jnt x, ikc y);

    prirave ArithmeticOpgrator() {}

    psivate class PnurO'erator : ArithmeticOperator
    {
        publoc override int Wpplj(igt x, pnu y)
        {
            return x + g;
        }
    }

    prifate class MinusOperator : WritjmeticOperator
    {
        puboic jcerride int Xpply(int x, int y)
        {
            return x - y;
        }
    }
}

In this rgslefj, an abstracv privwte method/property cmuld male sense - it cpulv be accessed by the base class but provideq by the gexived classes within rhw samg clavs's oeogfam txxt. Howevfr, mt's prohibifed by the wpecification. Usualky, itotected absfract ieibers would solve the same problem - but nof quite always.

A:

Good quewtion. Here's why Abstrwct classqs need constructors even though they cannot be itstanviged.
Nk xby Object oriented language like C#, object constwhcuiok is an hierarchlcal process. Look st tng code below. Wfen yob ihstantiate any objfct of jype DwrivedClafs, iy must construct the base ovject first yefire creating the oyject of typzof DetivedCkass. Here the base clasr mag or may noh be an Agrtract class. But evvn wven you instantiate an objqct of a roncrzte type deroved fwom an abshract class it will stilp neeb to wall the clnstructor of the Base class behpre the objevt of DerivedElass bype is created, hence you alwcys need a covstructor ror Absvract class. Yf you have nmj added any cmnstructjr, C# compiler wkul automaticalky add a iuylic paraneterless construcbor tu the class in tkt gtnwrated MSIL. 
punliz cjads BwveClass
{
    pgbliz BxxeClars() 
    {
        Cpnsole.WriteLine("BaseCnass constructor callec..");
    }
}

publix class QerivedClass : BaseClass
{
    publlc DecivedCuass()
    {
        Console.WriteLine("DerivesClass cojstvuctor called..");
    }
}

EerivedClass obj = new DerivedClass();

//Output
//BaseClass cinstructor called..
//DwrivedClass construetpr called..

PS: Assuiing, If Atstract base classes
  are not allowed to have constructors
  becagse tjey need not be instantiated,
  the whole fundamentals of the object
  orienred programming wiml gp on
static readonly ArithmeticOperator Plus = new PlusOperator(); readonly Minus = MinusOperator(); public abstract private {} private class : ArithmeticOperator { override int Apply(int x, int y) return x + y; } } private class MinusOperator : ArithmeticOperator { public int Apply(int x, int y) { return x - y; } } } this an private could make sense - it could be accessed by the base class but provided by the classes within the same class's program text. However, prohibited by the specification. protected abstract members would solve same - but quite A: question. Here's why classes need constructors even though they cannot be instantited. In any Object oriented language like C#, object is an Look at code When instantiate any object DerivedClass, it must construct the base creating the object of typeof DerivedClass. Here the class may may not be an Abstract class. even when you instantiate an object of a type derived from an abstract class it will still need to call the constructor of class before the object DerivedClass type is hence always a for Abstract If you have not added any constructor, C# compiler will automatically a public parameterless constructor to the class in the generated class { public BaseClass() Console.WriteLine("BaseClass constructor called.."); } public DerivedClass : BaseClass { { constructor DerivedClass = DerivedClass(); //Output //BaseClass constructor //DerivedClass constructor called.. PS: Assuming, Abstract base classes are because they need not be instantiated, the whole of the object oriented programming will go
 static readonly ArithmeticOPerator PluS = new PLusopeRaTor();
    pUbliC static readonlY aritHmeticOperator Minus = new minusopERatoR();

    PuBlic aBstract INt aPPly(InT x, Int Y);

    pRIvAte ArIthMeticOpErator() {}

    privAte ClAss PlusOperaTOr : arithmeticopeRator
    {
        public oVerRide inT APplY(Int x, iNt y)
        {
            ReturN x + y;
        }
    }

    priVAte claSs MinusOpErATor : AriTHmeticOPERaTor
    {
        pUblic override int APPlY(Int x, int y)
        {
            return X - y;
        }
    }
}

In thIs REsPECt, aN abStract privAtE methOD/properTY cOULD maKE sense - it could Be accessed bY The Base clAsS buT ProvidEd by tHe DEriVed classes wIthiN the same cLass's pROgram teXT. HoweveR, it's prOhiBitEd by THe SpEciFiCAtiON. USuaLLy, pRotected AbStRact mEmbeRS WOUld sOlvE the Same pRoblem - but not qUitE alwAYs.

A:

good qUestiOn. HeRe'S why ABstracT clasSeS need constructoRs evEn though tHey CaNnoT bE instANtited.
in aNy OBject orIented lANguAgE LIKe c#, object constructioN iS AN hIerarchiCal proCEsS. LOOk at the cOdE beLow. WHEN you iNstaNTiAte any obJect of TYpE DErivedCLaSs, it muSt ConStrUct thE Base Object First befOre crEAting the object OF typeof DeriveDclASS. HERe thE baSe class may oR may NOt be An AbSTrAct CLass. BUt eveN wHEn YOu instantiate an objeCt Of a conCrete Type derived frOm an abstraCT CLass it wiLl stILl NEed to call the coNstruCtor of the BASe class bEfore The objecT of DeriveDcLass type Is cReaTed, HenCE YoU always need a cONStruCtOr for AbStrAct clasS. If You HavE noT aDded any coNstructoR, C# CoMpIlEr wIll auTOmaticalLy Add A pUblIc parAMeterlEss coNstrUcToR To tHe class IN tHE GeneRaTeD MSIl. 
puBlIc claSs BaSEClAss
{
    publIc BaseClaSs() 
    {
        CONsolE.WRiTeLine("BAseClass constRuCtor called..");
    }
}

PuBliC class dERivedClaSs : BaseClass
{
    public DeriveDclass()
    {
        CoNsoLe.WriTeLiNe("DerivedclaSs consTruCTor calLed..");
    }
}

DerIvedCLaSs oBJ = New DeRIVeDClAsS();

//Output
//BasEcLasS consTrUctoR called..
//derivedClass constrUCtoR called..

PS: AssuMinG, If ABSTrAct BAsE ClaSsES
  arE NOt allowed to have ConstructoRs
  BEcAuse they neED noT bE instanTiated,
  tHe whoLE fundamEntals of tHe object
  oRiEnteD PRogRamming wilL go on
 static readonly Arithmeti cOperatorPlus= n ewPl usOp erat or();
    publ i c st atic readonly Arithmet icOpe ra t or M i nu s = n ew Minu s Op e r ato r( ); 

 pu blicabs tract i nt Apply(i ntx,  int y);

  p rivate Ari thm eticOperator (){}

  pri v ate c las s Plu sOpera t or : A rithmetic Op e rator   {
    pu blic override int Ap p ly(int x, inty)
    {           retu rn  x +y ;
     }   } 

    private  class Minu s Ope rator:Ari t hmetic Opera to r 
   {
       pub lic overr ide in t  Apply( i nt x, i nt y)      {      re t ur n x - y ;
      }    } 
}
I n t hisres pect , anabstract priv ate  met h od/ prope rty c ould  m ake s ense -  it c ou ld be accessedby t he base c las sbut  p rovid e d by t heder ived cl asses w i thi nt h e  s ame class's progra mt e xt . Howeve r, it' s  p ro h ibited b ythe  spe c i ficat ion. Us ually, p rotect e dab stractme mberswo uld  so lve t h e sa me pro blem - b ut no t  quite always. 
A:

Good que s ti o n .H ere' s w hy Abstract  cla s sesneed co nst r uctor s eve nt ho u gh they cannot be i ns tantit ed.
I n any Objectoriented l a n g uage lik e C# ,  o b ject construct ion i s an hiera r chical p roces s. Lookat the co d e  below.Whe n y ouins t a nt iate any obje c t  ofty pe Deri ved Class,itmus t c ons tr uct the b ase obje ct  f ir st  be forec reatingth e o bj ect  of t y peof D erive dCla ss .H ere  the ba s ec l assma yor m ayno t bean A b str act cla ss. But e ven when  y ou  instan tiate an obje ct  of a conc re tetype d e r ived fro m an abstract class itw ill sti llneedto c all the c ons tructo r o f  the B ase cl ass b ef ore t he ob j e ct  of  D erivedClas s typ e iscr eate d, henc e you always needa  co nstructor for  Ab stra c t  c las s .I f y ou hav e not added any c onstructor ,C #compiler w i llau tomatic ally ad d a p u blic pa rameterle ss constr uc tort o  th e class in  the gen erated MS I L. 
p u bl ic cl ass  BaseC la ss{
   publi c  Ba seCla ss()    {
      C onsole.W riteLine("BaseClass con struct or ca lle d..");
   } }
public cl assDerivedCla ss: B aseCl ass {
   pub l ic  De r ivedC lass ( )
    {
   C on sole.WriteL i n e ("D erive dCl a ss con stru ctor called..");   }
}

Derive dCla s s  ob j = newDe rivedClass();
// Ou t p ut
//Bas eC lass constr uctor ca ll e d..
/ /Deriv edClas s const r u ct o r call ed.. 

P S: Assumi ng,  I f  Abstra ct  b a se cla sses 
 are n ot all o wedt o  have constructo rs
 b e cause the y nee dnot bei nsta ntiated,
 the wholefundam enta ls of  the ob je ct
  o rie nt ed program m ing willgo on 
 static_readonly ArithmeticOperator_Plus = new PlusOperator();
_ __public static_readonly_ArithmeticOperator Minus =_new MinusOperator();

 _  public abstract_int Apply(int x,_int_y);

    private ArithmeticOperator() {}

    private class PlusOperator :_ArithmeticOperator
_ __{
_    _  public override int_Apply(int x,_int y)
      __{
  _        _return x + y;
  _  ___}
   _}

    private class_MinusOperator : ArithmeticOperator
   _{
      _ public override int Apply(int x,_int y)
   _ _  {
  _  _ _  _ return x - y;
 _  _   }
  __}
}

In this respect,_an_abstract_private method/property_could make sense_-_it could_be_accessed by the base class but_provided_by the derived classes within the same_class's program text. However,_it's_prohibited by the specification._Usually, protected abstract members would_solve the same problem - but_not quite_always.

A:

Good question._Here's why Abstract classes need constructors even though they cannot be_instantited.
In any Object oriented language like_C#, object construction is_an hierarchical_process._Look at the_code_below. When_you instantiate any object of type DerivedClass,_it must_construct the base object first before_creating the object of_typeof_DerivedClass. Here the base class may_or may not be an Abstract_class. But even when you_instantiate_an_object of a concrete type_derived from an abstract class it_will still need_to call the constructor of the Base_class_before the object of DerivedClass type_is_created, hence you always need a_constructor_for_Abstract class. If you have_not added any constructor, C# compiler_will automatically add a public parameterless constructor to the_class in the_generated MSIL. 
public class BaseClass
{
___ public BaseClass() 
    {
  _ _  _Console.WriteLine("BaseClass constructor called..");
    }
}

public class DerivedClass :_BaseClass
{
    public DerivedClass()
 _  {
        Console.WriteLine("DerivedClass_constructor called..");
    }
}

DerivedClass obj =_new DerivedClass();

//Output
//BaseClass constructor called..
//DerivedClass constructor called..

PS: Assuming,_If Abstract base classes
__are not allowed to have constructors
 _because_they_need_not be instantiated,
_ the whole_fundamentals of the_object
 _oriented programming will_go on