What is the difference between x++ and ++x in Java
Can anybody please tell me the difference of the above by refering the below code,
class Example{
public static void main(String args[]){
int x=10;
int y;
y=x++; //Prints 11 10
System.out.println(x+"\t"+y)
}
}
class Example{
public static void main(String args[]){
int x=10;
int y;
y=++x; //Prints 11 11
System.out.println(x+"\t"+y)
}
}