Hello,
I`m reading from the K&B
SCJP Exam book, and i've stumble upon the next rule for constructors:
- if the constructor has private modifier , if we want to allow an instance of the class to be used, we must provide a static method or variable that allows access to an instance created from within the class.
Why does it have to be a static method?
Can anyone help me with a link or provide a small example.
Thank you,
Mihai Lita