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 -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -