~/ learn/ comp-308/ cards/ OOP Recap at COMP 308 Level
1 of 17

Type an aliasing assignment (two references, one object)

Type an aliasing assignment (two references, one object)

Answer

StringBuilder b = a;

Copies the reference, not the object. b and a now refer to the same heap object, so a change through one is seen through the other.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/4921f4ce-0cf6-45be-82ed-9433d4ccdf22/flashcard utf-8 LF