hi frnds i have a simple doubt i.e can a constructor have an access modifier other than what class has ??? coz i read some where that the constructor has the same access modifier as that of class....
Yes it can . This of a singleton class whose c'tor is private. It's also a method in a class but a special method without return value. [ September 23, 2005: Message edited by: Srinivasa Raghavan ]
If a class declares no constructors then a default constructor, which takes no arguments, is automatically provided. If the class being declared is Object, then the default constructor has an empty body. Otherwise, the default constructor takes no arguments and simply invokes the superclass constructor with no arguments. If the class is declared public, then the default constructor is implicitly given the access modifier public. Otherwise, the default constructor has the default access implied by no access modifier (�2.7.4).