Example:
package javaapplication;
/**
*
* @author Rathorji
*/
public class JavaApplication {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int p = 5;
int q = 5;
p++;
q++;
System.out.println("p = " + p);
System.out.println("q = " + q);
int m = p++;
int n = ++q;
System.out.println("m = " + m);
System.out.println("n = " + n);
}
}
output:
run:
p = 6 q = 6 m = 6 n = 7 |