if (a.equalsIgnoreCase("yes")) {
...
}
(or equals
if you want to match "yes"
exactly)
More Related Contents:
- Why can't we declare variables in if statement?
- java if else errors not working properly
- Repeat the “if” statement if it has to go to the “else” statement
- Result from printing statement and if statement differ
- Conditional Statement on Java7
- Android: If statement being skipped even if condition is correct
- Why am I getting “Error: ‘else’ without ‘if'”? [duplicate]
- Multiple statement is passed in IF condition using OR, how to find which statement is true?
- New to Java and having issues writing and example
- Why is my if statement an error?
- Semicolon at end of ‘if’ statement
- What is the relative performance difference of if/else versus switch statement in Java?
- How can I check if an app running on Android?
- Error: ‘else’ without ‘if’
- && (AND) and || (OR) in IF statements
- Best way to format multiple ‘or’ conditions in an if statement
- Compiler error when declaring a variable inside if condition and no curly braces
- Java Swing; Two classes, where to put if statements and new actionlisteners?
- How to avoid a lot of if else conditions
- What is better: multiple “if” statements or one “if” with multiple conditions?
- How to check if a string starts with one of several prefixes?
- How to use this boolean in an if statement?
- Java if vs. try/catch overhead
- Refactoring if/else logic
- Short IF – ELSE statement
- Why Java does not see that Integers are equal?
- How is String in switch statement more efficient than corresponding if-else statement?
- Which “if” construct is faster – statement or ternary operator?
- If-else working, switch not [duplicate]
- How is if/while condition evaluated when we use assignments instead of comparison?