If Base class have parameterless private Constructor, and Derived class have parameterless public constructor 

can we create an object of Base Class/ Derived class?? Inheritance is possible??

  class BaseClass
    {
        private BaseClass()
        { }


    }
    class DerivedClass : BaseClass
    {
        public DerivedClass()
        { }

    }


Answer: 'BaseClass.BaseClass()' is inaccessible due to its protection level

Comments

Popular posts from this blog

iframe vs embed vs object in HTML 5

Constructor in c#

What is the need of method overriding ???