Java splits all types into two categories. Primitive types (int, double, boolean, char, byte, short, long, float) store values directly. When you write int a = 5;, the number sits right there in the variable's memory slot.
Reference types (String, arrays, objects) store a reference that points to data elsewhere in memory. When you write String s = "hi";, the variable s holds an address, not the text itself.
This affects how assignment works. With primitives, int b = a; copies the value. Changing b doesn't affect a. With reference types, copying a variable copies the reference, not the data. Two variables can point to the same object, and changes through one are visible through the other.