Here is how my last interview went:
Question: Where are strings stored?
Answer: Heap since it is a reference type
The command one = ...
sets the *pointer named one
to a new value. Since two
is a different pointer, it retains it's original value.
The command one.someString = ...
modifies the object referred by one
. two
is still a different pointer, but since it points to the same object, the modifications are shared between them.