This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one for details.
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.