I have run into a limitation in my knowledge of OOP.
If I write Object1 = Object2, why doesn't Object1 get it's
own block of memory to play with? Instead, they both
share the same memory as you can see if you run this
code below:
here!
How do I copy an object along with all of it's field
values so that it is a separate entity from it's parent?
If I write Object1 = Object2, why doesn't Object1 get it's
own block of memory to play with? Instead, they both
share the same memory as you can see if you run this
code below:
here!
Strict Type testType Field a:Int Method update() a:+1 EndMethod EndType Local test1: testType = New testType Local test2: testtype = test1 For Local b = 1 To 5 test1.update test2.update Next Print test1.a Print test2.a
How do I copy an object along with all of it's field
values so that it is a separate entity from it's parent?