1int num = 9;
2
3if (num == 1 || num == 2) {
4 System.out.println("Nope");
5 }
6
7if (num == 1 || num == 9) {
8 System.out.println("Yep");
9 }
1foo = 32; // 32 = 0b00100000
2bar = 9; // 9 = 0b00001001
3baz = 10; // 10 = 0b00001010
4foo |= bar; // 32 | 9 = 0b00101001 = 41
5 // now foo = 41
6foo |= baz; // 41 | 10 = 0b00101011 = 43
7 // now foo = 43
1// Arithmetic operators in java
2public class ArithmeticOperatorDemo
3{
4 public static void main(String[] args)
5 {
6 int i = 25;
7 int j = 5;
8 System.out.println(i + j);
9 System.out.println(i - j);
10 System.out.println(i * j);
11 System.out.println(i / j);
12 System.out.println(i % j);
13 }
14}