Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures - Retired Exploring the Java Collection Framework Using ArrayLists

mistake on tutorial?

At the end of this tutorial, setTitle method should actually change the title "Build a Simple App" right? Since javaCourse has been re-assigned to point to another course object, the previously one should be deallocated automatically and thus no longer be able to pointe to...right?

Mark VonGyer
Mark VonGyer
21,239 Points

I don't know what you mean. Do you mean the object parameters would be replaced with the new object parameters? I think when a new instance is created it obtains a unique ID and the garbage collector wouldn't remove it until all references to the instance had been exhausted. So, the two new objects would be able to co-exist even though they have the same name.

I would be interested to know too what happens here!

2 Answers

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Whoa whoops! Yeah that is supposed to be javaCourse and androidCourse and then add them both to the list. Sorry 'bout that. Will fix. Thanks for pointing that out, totally didn't notice it.

thank you for the clarification!

Craig Dennis Are you able to answer this? I was wondering the same thing..