-
how to create an copy of an object
I am using c#.net(2005)
The problem with the assignment like is,
Object obj=new object();
Obj=this; (current class)
Reflection (i.e) if we change in the Copied object the pasted object is changing according to the change made.
Can you please help me in this.
-
Nanda1605,
For "simple" objects whose properties are value types, create a Clone method for the object that uses MemberwiseClone to make a shallow copy.
For objects with properties that are reference types, implement the ICloneable interface.
Kerry Moorman
Similar Threads
-
Replies: 2
Last Post: 06-11-2006, 11:19 AM
-
By shachar in forum VB Classic
Replies: 1
Last Post: 03-31-2001, 01:02 AM
-
By Mary in forum Architecture and Design
Replies: 0
Last Post: 12-08-2000, 12:37 PM
-
By Michael Kascher in forum VB Classic
Replies: 2
Last Post: 05-31-2000, 02:48 PM
-
By Steven King in forum VB Classic
Replies: 7
Last Post: 04-19-2000, 12:05 PM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks