Unary Operator Example in Java

Java Programming Language / Operators in java

2061

Program:

 public class OperatorExample {
public static void main(String args[])
   {  
    int x=10;  
    System.out.println(x++);//10 (11)  
    System.out.println(++x);//12  
    System.out.println(x--);//12 (11)  
    System.out.println(--x);//10  
   }
}  

Output:

10
12
12
10

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.