Logical Operator List and True table
public class Main {
public static void main(String args[]) {
int a = 1;
int b = 2;
int c = ++b;
int d = a++;
System.out.println("a = " + a);
System.out.println("b = " + b);
System.out.println("c = " + c);
System.out.println("d = " + d);
}
}
add an integer variable by one.
increment operator: two successive plus signs, ++.
decrement operator: --.
public class MainClass {
public static void main(String[] argv) {
int count = 10;
++count; // Add 1 to count
–count; // Subtract 1 from count
System.out.println(count);
}
}