Java: Please tell Me what's wrong? -


here's code:

system.out.println("qualifies instate rate: "); instate = keyboard.nextline(); while((instate.equalsignorecase("yes") == false || instate.equalsignorecase("no") == false)) {     system.out.println("enter either yes or no:");     instate = keyboard.nextline(); } 

my problem output never-ending; here's output

enter either yes or no: no enter either yes or no: no enter either yes or no: yes enter either yes or no: yup enter either yes or no: 

it doesn't matter enter in keyboard. please tell me problem , possible solutions.

change:

system.out.println("qualifies instate rate: "); instate = keyboard.nextline(); while((instate.equalsignorecase("yes") == false || instate.equalsignorecase("no") == false)) {     system.out.println("enter either yes or no:");     instate = keyboard.nextline(); } 

to:

system.out.println("qualifies instate rate: "); instate = keyboard.nextline(); while((instate.equalsignorecase("yes") == false && instate.equalsignorecase("no") == false)) {     system.out.println("enter either yes or no:");     instate = keyboard.nextline(); } 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -