public static void main(String[] args) {
int a = 1;
int b = a++;
System.out.println(b);
}
Why does the code above print 1? I was told that a++ means you would get the value of a. then increment it. But the code above never incremented a and just printed 1. Could someone please explain what is going on here?