Hi all, When can a class be declared private? Cheers, Brian
Joined: Oct 21, 2000
when it is an inner class.
Joined: Oct 30, 2000
Joined: Jan 08, 2001
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