Can anyone help me.. I cannot seem to get this menu looping
Code :
public class Test {
// This project is 3 parts. A menu which you can get to the other parts.
// There is then the printing pattern which
/**
* @param args
*/
public static void main(String[] args)
{
if (args.length == 0)
{
boolean loop = false;
do {
//Initialising the Scanner which is
//used to pick up the users input
Scanner sc = new Scanner(System.in);
//Menu - This is the menu in which you choose what
// you want to do in the program
System.out.println("Menu");
System.out.println("a. Character Pattern");
System.out.println("b. Reverse Text");
System.out.println("x. Exit The Program");
String MenuIn = sc.nextLine();
System.out.println("You Chose " + MenuIn);
if (MenuIn.contentEquals("a")||MenuIn.contentEquals("A"))
{
Printingpatterns();
}
else
{
if (MenuIn.contentEquals("b")||MenuIn.contentEquals("B"))
{
Reverse();
}
else
{
if (MenuIn.contentEquals("x")||
MenuIn.contentEquals("X"))
{
System.exit(0);
loop = true;
}
}
}
} while (loop = false);
}
}
}
Re: Can anyone help me.. I cannot seem to get this menu looping
} while (loop = false);
Test for equality with ==
Re: Can anyone help me.. I cannot seem to get this menu looping
Quote:
Originally Posted by
Norm
} while (loop = false);
Test for equality with ==
I knew there was something obvious wrong :/.. That's fixed it.. thank you :o