What is the difference between garbage and dangling references?
A dangling reference is a reference to an object that no longer exists. Garbage is an object that cannot be reached through a reference.
Dangling references do not exist in garbage collected languages because objects are only reclaimed when they are no longer accessible (only garbage is collected). In some languages or framework, you can use "weak references", which can be left dangling since they are not considered during collection passes.
In languages with manual memory management, like C or C++, you can encounter dangling pointers, by doing this for instance:
int * p = new int;
delete p;
int i = *p; // error, p has been deleted!