Here are some points
you should keep in mind for gc:
1) finalize method is run only once by JVM on the object next time it becomes eligible for GC JVM doesnot call the finalize again.
2)
Java maintain
String literal table sso handling string is different from other objects (specially in case of questions like how many objects created and how many of them are eligible for GC)
3)Remember we are talking about the objects and not refrences so track the object and refrence
4)its better you solve problem through object diagram