Quote Originally Posted by robertx
Got it. This is the bit that I missed:



So what actually happens to obj1 when var1 now points to obj2?
Nothing. Let's say that you have a Person class and that class has a Car property. I'm a Person object and my Car property refers to a Car object. If I buy a new car my Car property now refers to a new object. What happens to the old object? Nothing, that's what. It's no longer referred to by my Car property is all. If my partner was sharing the car with me then her Car property still refers the original car.

Are you starting to get the idea that Object-Oriented Programming is so-called because it is modelled on real-world objects? If you want to understand an OOP concept then just look at the real world and 99% of the time it will show you.