In this example,
int x = 5;
int y = x;
x = 4;
y will remain 5 because x is just being reassigned and it is not manipulating the object it u
primitive variables actually hold the value (not the reference). So at any point of time you create a primitive variable, a memory block (of that primitive type) gets reserved for a value, no matter you have assigned a value for that or not.
(in any low level language you can think of a variable as a register)