[SOLVED] How do I re-start a class?
I've got a little problem, this I couldn't seem to find a solution for, so I figured I'd post about it.
I'm still pretty much a beginner so the project is pretty simple, just a multifunction calculator for the command line.
What I want to do is enable the program to restart itself, if the user tells it to.
All of the coding in done in one class.
Anyway here is the bit of code where I have the problem. (Yes I know it's ugly LOL)
Code:
System.out.println("What Now?");
System.out.print("\n");
System.out.println("[1] = Continue");
System.out.println("[2] = Exit Program");
System.out.print("\n");
Scanner DivSelect = new Scanner(System.in);
int DivChoose = DivSelect.nextInt();
if(DivChoose == 1)
{
System.out.print("\n");
Calculator ReStart = new Calculator();
System.out.print("\n");
}
else if(DivChoose == 2)
{
System.out.print("\n");
System.out.println("Goodbye");
System.out.print("\n");
}