|
-
Aug 9th, 2002, 08:59 AM
#1
Thread Starter
Member
How do I create a New copy of a Class
Is there a way to create a new copy a class? For example, if myClass1 and myClass2 are Classes of the same Type and you set myClass2 = myClass1, then properties in myClass2 will change if properties in myClass1 change. I want it so that myClass2 is a new instance that is identical to myClass1.
Thanks. Lance
-
Aug 9th, 2002, 10:02 AM
#2
It depends on the class, most classes should have a clone method that you can use:
myClass2=myClass1.Clone
If not you could serialize it or maybe there is another way.
-
Aug 9th, 2002, 12:32 PM
#3
Thread Starter
Member
serialize sounds like an interesting idea. i'll look into it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|