which relationship between private constructor and derivation class

gorangk's Avatar, Join Date: Mar 2007
Newbie Member
which relationship between private constructor and derivation class that derivation is not possible
(meaning constructor implements the actions required to initialize an instance)
mean - stop create instance ok, but derive class ?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I could not get what you are looking for?
gorangk's Avatar, Join Date: Mar 2007
Newbie Member
thank for time,so
at few place i see that private constructors in class, arrest
1) create instances of the class
2) for other class to derive from the class
i can't see logic for the second point
************************************************** **********
microsoft -c# language specifications-page 215
When a class declares only private constructors it is not possible for other classes to derive from the
class or create instances of the class (an exception being classes nested within the class). Private
constructors are commonly used in classes that contain only static members. For example:
************************************************** *************
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Private constructor makes a class
1. singleton by exposing the instance of the object. As constructor is private you cannot create the objects but are bound to use the predefined method to get the object of the class.
2. You cannot derive a class from the class which has private constructor.