Take a step back. Write a simple test program that lets you play with if/else statements. Feed in hard-coded booleans, like the example aussiemcgr already posted.
Type: Posts; User: KevinWorkman
Take a step back. Write a simple test program that lets you play with if/else statements. Feed in hard-coded booleans, like the example aussiemcgr already posted.
What red bar?
What have you tried?
Yes, it does.
Did you check out the keyword I told you about? What did you try with it?
In fact, you can do it without that keyword, using only the logic you demonstrated in your original post....
Check out the else keyword: The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)