dummy question about private constructor

ely (Ely)
I'm studying Java from the very begining. I read the following defination of private constructor:

"Private- No other class can instantiate your class. You class may contain public class methods and those methods can construct an object and return it, but no other classes can."
I tried to declare a public method to construct an object in the class but was confused with the syntax and i also don't know how to call this method in other classes since new object can't be created out of the original class.
Anybody can give me an example?Thanx!
2000-11-26 -05:00

回到话题: dummy question about private constructor

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论