jrvbdeveloper
Member
- Joined
- Jul 15, 2007
- Messages
- 17
- Programming Experience
- Beginner
Hi,
In my code, I was basically assigning 1 object (self-created) to another. For example,
car1 As Car
car2 As Car
car2 = car1
I realize that both car1 and car2 are supposed to be referencing the same object. However, when I change a paremeter of one of the objects, the other does not change, so I am confused. I *do not* want the other object to change, so can I leave my code as is? Or do I need to create a clone method, but why isn't this causing me problems?
In my code, I was basically assigning 1 object (self-created) to another. For example,
car1 As Car
car2 As Car
car2 = car1
I realize that both car1 and car2 are supposed to be referencing the same object. However, when I change a paremeter of one of the objects, the other does not change, so I am confused. I *do not* want the other object to change, so can I leave my code as is? Or do I need to create a clone method, but why isn't this causing me problems?