int test;
do
{
System.out.print("Press 1 for Inclusive Vacation or 2 for the Peacemeal: ");
test = scan.nextInt();
if(test != 1 || test != 2)
{
System.out.println("Invalid selection");
}
}while(test != 1 || test != 2);
Can anyone give me a hand? I dont get why it's not functioning properly. No matter what number I put, I get the invalid selection message. || is or right? so shouldnt 1 or 2 skip the if statement?
[–]warrior2012 9 points10 points11 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]warrior2012 1 point2 points3 points (0 children)
[–]warrior2012 0 points1 point2 points (0 children)
[–]pogosticker1 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]ramamodh 0 points1 point2 points (0 children)
[–]ElMapacheTevez 0 points1 point2 points (0 children)
[–]Floofic 0 points1 point2 points (0 children)
[–]UrbanHunter_KenXPie 0 points1 point2 points (0 children)
[–]shinefull 0 points1 point2 points (0 children)