Hi all, I would like to know how to create an object or a class with private constructor.
I know one such way. Creating a static method in the class which will create an object and return the object of the class. The singleton approach.
I think I can use Class.forName(
String). But I am not pretty sure.
I hope reflection api also will help but not sure.
Can anyone please tell me what are the different ways to create an object whose class has a private Constructor?
Thank you all in advance. Good day.