java logic operators code example
Example 1: condition operator in java
b = (a == 1) ? 20: 30;
Example 2: 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);
}
}