Source of TestDoublePlusOperator.java


  1: //TestDoublePlusOperator.java
  2: 
  3: public class TestDoublePlusOperator
  4: {
  5:     public static void main(String args[])
  6:     {
  7:         //Illustrating the use of ++ in expressions
  8:         //=========================================
  9:         int m = 4;
 10:         int result = 3 * (++m);
 11:         System.out.println("m = " + m + " and result = " + result);
 12: 
 13:         int n = 4;
 14:         result = 3 * (n++);
 15:         System.out.println("n = " + n + " and result = " + result);
 16:     }
 17: }
 18: