Mega Code Archive

 
Categories / Java Tutorial / Operators
 

The op= Operators

count += 5 has the same effect as the statement: count = count + 5; public class MainClass {   public static void main(String[] arg) {     int count = 1;     count += 5;     System.out.println(count);     count = count + 5;     System.out.println(count);   } } 6 11 The complete set of op= operators: += -= *= /= %= = &= |= ^=