4 ms·
OP literally says this in the next sentence: > But if a and b are both variables of the same Java class type, or Python lists, then after the assignment they r
by beambot 13y ago
OP literally says this in the next sentence:
> But if a and b are both variables of the same Java class type, or Python lists, then after the assignment they refer to the same underlying object, so that if you make a change to a (e.g. by calling a class method on it, or appending an item to the list) then you see the same difference when you look at b.
- rcxdude 13y agoHis point is that there isn't a difference in python: in both cases you're just changing labels, but in the case of integers they're pointing to immutable objects.