DarkGhost368
Member!
Hey, I was coding this do-while loop and it doesn't work properly. everytime I enter a valid entry (N,S,E,W) it repeats the loop. Can someone explain this to me? I'm still new too java.
Code:
char heading;
do{
System.out.println("Enter Direction (N,E,S,W)");
heading = IN.readLine().toUpperCase().charAt(0);
}while((heading != 'S')||(heading != 'E')||(heading != 'S')||(heading != 'E'));