java operator OR 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: Operators in java
// java unary increment (++) operator
public class JavaUnaryOperator
{
public static void main(String[] args)
{
int a = 23;
// 23 gets printed and increment to 24
System.out.println("Java post-increment = " + a++);
// a value was 24, incremented to 25
System.out.println("Java pre-increment = " + ++a);
}
}