I have a class Game that is my main class and a second class Card. Class Card hast its properties and constructor private, only function init is public. Function init checks
Class> class = Class.forName("SomeClassName");
Constructor> constructor = class.getConstructors[0];
constructor.setAccessible(true);
To convert the privately declared constructor to the public one till program execution. Also, this concept is related to Reflection API.
Object o = constructor.newInstance();
if(o.equals(class)) {
System.out.println("Object for \"SomeClassName\" has been created");
}