So far I have written choice as a string but I need to write it to accept int instead of string. The user has to enter 1, 2, 3 and if they enter 1 or 2 the program should continue but if the user enters 3 the program ends.
normally I write the choice as
String choice = "y";
while (choice.equalsIgnoreCase("y"))
{
Is there a way to write the code similar to that? I found a way using if statements but that screws up the rest of my code so I’m trying to find a way around that.
Thanks,
it would be better to to this with a so called switch construct