Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9104123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:47:29+00:00 2026-06-17T01:47:29+00:00

I was struck by how copying a collection object in C# can be quite

  • 0

I was struck by how copying a collection object in C# can be quite cumbersome, especially if you want a deep copy. Is there a good design reason why .Net didn’t go the Java clone() route, and is there some equivalent paradigm I’ve missed in C#/.Net?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:47:30+00:00Added an answer on June 17, 2026 at 1:47 am

    Shallow Copies

    For shallow copies, .NET offers Object.MemberwiseClone.

    Deep Copies

    For deep copies, Microsoft suggests to implement a custom Copy method. Deep copies require intricate knowledge about the class itself — in fact, for a given class, it might even make sense to make multiple different types of deep copy. Thus, there is no pre-defined method or interface for this purpose.

    But what about the ICloneable interface?

    There is the ICloneable interface, whose purpose might correspond roughly to Java’s Object.clone. However, Microsoft advises against its use, since it does not specify how shallow or deep the copy needs to be for the interface to be implemented correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a collection of classes that behave like math vectors, so
Here's an interesting question ... is there a collection that is a struct somewhere
Xcode 4 completely changed the (project) template system. There's a lot more you can
I am having a bit of trouble deep copying a pointer to a map
This struck me as really weird behaviour and I spent a while checking for
I have a struck with an array of pthread pointers. Each thread is meant
It has always struck me as strange that the C function fopen() takes a
Once again my silliness has struck. I would like to thank everyone who helped
I am using CodeFirst approach and struck with an issue where I need to
In SQL Server 2005 I just struck the infamous error message: Introducing FOREIGN KEY

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.