I'm trying to write an program that let's you choose between two things. But after executing the option that I chose, I want to be able to return the the beginning of that same option.
switch (option) {
case 1:
System.out.println("Start of option 1");
//option 1 will do things here
System.out.println("End of option 1");
//I want to return at the beginning of this case at the end of it
break;
case 2:
System.out.println("Start of option 2");
//option 2 will do things here
System.out.println("End of option 2");
//I want to return at the beginning of this case at the end of it
break;
default:
break;
}
An option to get out of the selected case too. Also, would it be easier to implement what I'm trying to do with the use of if-statements instead?