jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "....." Watch "....." New topic


devika cha

Joined: Dec 17, 2003
Posts: 23
Can a class be private?

Joined: Apr 12, 2000
Posts: 16
only inner classes can be private.
nested-top level classes cannot be private
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

Top level classes can ONLY be "public"
or (so called) "friendly" ie; without
any access modifier.
NOT "private"
NOT "protected"
Again... summing up ...
- satya
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Nested top-level classes, i.e. static member classes or so-called "static inner" classes, certainly can be private. Non-nested top-level classes ("normal" or package-level classes) must be public or default.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link: http://aspose.com/file-tools
subject: .....
It's not a secret anymore!