File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Private Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


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

Private

Brian, Cavanagh
Ranch Hand

Joined: Oct 30, 2000
Posts: 70
Hi all,
When can a class be declared private?
Cheers,
Brian
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

when it is an inner class.


SCJP
Visit my download page
Brian, Cavanagh
Ranch Hand

Joined: Oct 30, 2000
Posts: 70
of course!!!
Golam Newaz
Ranch Hand

Joined: Jan 08, 2001
Posts: 64
Hi,
I am giving a little more important information about private.
First you have to know what is access modifier. There are four
important access modifier:

private
public
protected
package access

public : Anybody can create an instance of your class.
In turn, if you use private modifier, no other
class can instantiate your class as an object.
Your class can still contain public class methods,
and those methods can construct an object and
return it, but no one else can.
Thanks,
Golam Sayeed Newaz

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Private