I am getting this error:
'CTest.AA ()' is unavailable
Public class A {Private A () {}} Public class B: A {public Zero Sehelo () {console .WriteLine ("Hello"); }}Why can anyone explain why?
By default the constructor for A is private, as a constructor
protected A () {} Try it.Class
B automatically calls the default constructor ofA , if it is not accessible forB Or there is no default constructor (if you have a constructorprotected A (string s) {} )B can not be started correctly.The compiler automatically generates the following default constructor in
Where is the real call to the constructor of
base () reala .
Comments
Post a Comment