Class declaration has nothing to do with method declaration. You have to expicitly give access modifiers to constructors or methods. However, there is one exception. If we do not write any constructors ourselves, in that case the compiler provides us with default constructor and the access modifier for that constructor will be same as the its class's access modifier. Also, a class can have only public or default access levels.
Joined: Aug 03, 2002
"Also, a class can have only public or default access levels."
For top-level classes, yes. But not nested classes.
Joined: May 03, 2005
Yes. I should have been more specific. Thanks Barry.