final Integer a = 1;
Integer b = a;
System.out.println("a: " + a); // prints 1
System.out.println("b: " + b); // prints 1
b++;
System.out.println("a: " + a); // prints 1
System.out.println("b: " + b); // prints 2
b = b + 1;
System.out.println("a: " + a); // prints 1
System.out.println("b: " + b); // prints 3
b = 10;
System.out.println("a: " + a); // prints 1
System.out.println("b: " + b); // prints 10
It would be great if somebody could explain the code output, expecially with relation to variable B.