I see a lot of GC-related questions on this forum. From my perspective, there are two main reasons why GC is on the exam:
1 - Java Programmers need to know how to allow the GC to collect objects they no longer need.
2 - Many Java Programmers aren't 100% clear on the differences between:
- A. The Stack vs. the Heap
- B. Objects vs. Reference Variables
- C. Pass by Value vs. Pass by Reference
- D. How the "Pass by" stuff relates to references vs. primitives
My experience is that once you totally have the concepts above nailed down, you'll find GC questions pretty easy. On the other hand, if you aren't totally solid on all of the above, GC questions can easily tie you up in knots
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)