File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 agree. Here's the link:
subject: public declaration
jQuery in Action, 3rd edition