Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "public declaration" Watch "public declaration" New topic
Author

public declaration

John Spindler
Greenhorn

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"
Sheriff

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
 
 
subject: public declaration
 
Similar Threads
text box in scjp. examples please..
abstract
Passed SCJP 6.0 81%
Interface
Initializing in a constructor versus a declaration