which relationship between private constructor and derivation class

Newbie Member
2Mar2007,16:01   #1
gorangk's Avatar
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 ?
Go4Expert Founder
2Mar2007,16:46   #2
shabbir's Avatar
I could not get what you are looking for?
Newbie Member
2Mar2007,19:40   #3
gorangk's Avatar
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:
************************************************** *************
Go4Expert Founder
5Mar2007,09:22   #4
shabbir's Avatar
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.