Using ++ and -- with floating-point variables : Increment Decrement Operators « Operators « Java Tutorial






public class MainClass{

  public static void main(String[] arg){
     double a = 12.12;
     
     System.out.println( a-- );
     System.out.println( a++ );
     System.out.println( --a );
     System.out.println( ++a );
  }

}
12.12
11.12
11.12
12.12








3.3.Increment Decrement Operators
3.3.1.Increment and Decrement: Demonstrate ++.
3.3.2.The increment and decrement operators
3.3.3.Using the increment and decrement operators in an expression
3.3.4.The prefix form and the postfix form
3.3.5.Using ++ and -- with floating-point variables