what does | OPERATOR do in java code example

Example 1: Operators in java

// Arithmetic operators in java
public class ArithmeticOperatorDemo
{
   public static void main(String[] args)
   {
      int i = 25;
      int j = 5;
      System.out.println(i + j);
      System.out.println(i - j);
      System.out.println(i * j);
      System.out.println(i / j);
      System.out.println(i % j);
   }
}

Example 2: Operators in java

// java unary decrement (–) operator
public class JavaUnaryOperator
{
   public static void main(String[] args)
   {
      int a = 23;
      // 23 gets printed and decremented to 22
      System.out.println("Java post-decrement = " + a--);
      System.out.println("a = " + a);
      // a value was 22, decremented to 21
      System.out.println("Java pre-decrement = " + --a);
   }
}

Tags:

Java Example