Originally posted by Hemal Mehta:
Can anyone explain of the constructor could be synchronized, static, final or private. Also please provide valid explanation.
Also can contructors have inheritance?
I really like Manfred's response
but, in short, you can only use the accessibility modifiers on a constructor (i.e. public, protected, private). You can leave off the access modifier and have a "default" accessible constructor but, since constructors aren't inherited, this is the same as having a protected constructor.
Public: Any class/object can create an instance of this class.
Protected/Default: Only classes/objects within this class' package can create an instance of this class.
Private: Only this class can create an instance of this class.
I hope that helps,
Corey
[ February 05, 2002: Message edited by: Corey McGlone ]