Last active
May 23, 2017 00:20
-
-
Save dhust/6134922 to your computer and use it in GitHub Desktop.
Operators - && (AND)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
int a = 14; | |
if ( (a > 0) && (a < 10) ) { | |
System.out.println("a is between 0 and 10."); | |
} | |
else if (a >= 10 && a < 20) { | |
System.out.println("a is between 10 and 20, including 10."); | |
} | |
else { | |
System.out.println("a is less than 0 or greater than 20, including 0 and 20."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment