incrementDecrement 4-1

posted Feb 1, 2014, 8:29 AM by dldar masud   [ updated Feb 1, 2014, 9:47 AM by Karwan Jacksi ]


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
// This program demonstrates the ++ and -- operators
package incrementdecrement;


public class IncrementDecrement {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        int number =4; //number starts out with 4

         // Display the value in number.
         System.out.println("number is " + number);
         System.out.println("I will increment number.");

         // Increment number.
         number++;

        // Display the value in number again
         System.out.println("Now, number is "+number);
         System.out.println("I will decrement number.");
    
          // Decrement number.
         number--;

         // Display the value in number once i
         System.out.println("Now, number is "+number);
    }
}

ċ
IncrementDecrement.java
(1k)
Karwan Jacksi,
Feb 1, 2014, 8:29 AM
Comments