This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes public declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "public declaration" Watch "public declaration" New topic

public declaration

John Spindler

Joined: Feb 12, 2002
Posts: 28
I need some understanding... I was under the impression that you could only have one public class declaration in any one class. However I now know that you can have a public class and a public static class declaration....This is rather confusing to me.. anyone want to shed some light as to why this is.?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
The public static class would be a class inside the public top-level one, so it doesn't count. It's not like you can rip a nested class out into its own file.
The rule only applies to Top-Level not nested classes.
[ March 14, 2002: Message edited by: Cindy Glass ]

"JavaRanch, where the deer and the Certified play" - David O'Meara
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: public declaration
It's not a secret anymore!