I was reading about generational garbage collection here. My understanding is that objects may be moved from one location to another in memory when GC runs. If objects are being moved, how are references to objects stored so that they are not invalidated?
Object ref = new Object();
What is saved in ref
?