So guys, I'm very new to Java and I have just developed my algorithm of opening forms. However, I've also recently read about singleton pattern. I don't know how Java works internally but I want to ask an expert's advice.
Is this implementation efficient? Compare it with singleton. How good or bad is it?
In my Main class, I have this:
private JFrame window;
public static void open(JFrame window){
this.window.setVisible(false);
this.window = window;
this.window.setVisible(true);
}
In the calling class, I do this:
Main.open(new FormName());