Increment/Decrement

++ (Increment) Increases the value by 1.
-- (Decrement) Decreases the value by 1.

Post-increment and pre-increment in java

//post increment and pre-increment
class demo1{
   public static  void main(String args[]){
      int x=20;
	  System.out.println(x);
	  
	  //post increment 
	  System.out.println(x++);  //value cannot be changed
	  //  it still show 20
	  //when you call again this statment 
	  System.out.println(x);
	  
	  //in post incrment value increment after compiler exectioin
	  //it will stored in compiler
	  //when u call again it will update value
	  
	  
	  
	  //In case of preincrement
	  int y=30;
	  System.out.println(++y);
	  //output is 31
	  //means value change during compile and show latest value
	  //on  screen
	  
	  
	  
	  
	  }
	  }
          

OUTPUT:
20
20
21
31
          

Post-decrement and pre-decrement in java

//post increment and pre-increment
class demo1{
   public static  void main(String args[]){
      int x=20;
	  System.out.println(x);
	  
	  //post decrement
	  System.out.println(x--);  //value cannot be changed
	  //  it still show 20
	  //when you call again this statment 
	  System.out.println(x);//output is 19
	  
	  //in post decrement value decrement after compiler //exectioin
	  //it will stored in compiler
	  //when u call again it will update value
	  
	  
	  
	  //In case of predecrement
	  int y=30;
	  System.out.println(++y);
	  //output is 29
	  //means value change during compile and show latest value
	  //on  screen
	  
	  
	  
	  
	  }
	  }
          

OUTPUT:
20
20
19
29
          

Address

Plot number-56/1
Near Gurudwara
LandMark :
Opposite A.N.D college
Govindpuri Metro station
New Delhi
Mobile number:
8826034620