I was just wandering if someone could help me how to redo a case statement.

After executing the program, there would be a line asking :
Try Again? YES / NO

If yes, then the program re-executes without hitting F5 again. (using JCreator pro 5).


All i have is this:

System.out.print("Tray again? (1=Yes/0=No)? ");
        int Answer = scnr.nextInt();

        if (Answer == 1)
           //DON'T KNOW WHATS NEXT HERE
        else
            //DON'T KNOW WHATS NEXT HERE

Snippet would be greatly appreciated.

You can do this using do while loop...

int Answer;
do{

// do you task here...

System.out.print("Tray again? (1=Yes/0=No)? ");
Answer = scnr.nextInt();
}while(Answer==1);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.