or symbol in java code example
Example 1: java or
int num = 9;
if (num == 1 || num == 2) {
System.out.println("Nope");
}
if (num == 1 || num == 9) {
System.out.println("Yep");
}
Example 2: java or symbol
//logical OR is || in Java
public static boolean or(boolean a,boolean b){
return a||b;
}
//bitwise OR is | in Java
public static int bitwiseOr(int a,int b){
return a|b;
}