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
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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: 4089
when it is an inner class.


SCJP
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
 
Similar Threads
displaying tag in jsp
How come public and friendly(default) access is allowed for top level class but not
WA #1.....word association
Bullet-proof Class
What is the difference between these statements