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 7639829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:31:21+00:00 2026-05-31T08:31:21+00:00

Consider this related question: Deep cloning objects Is this really the best way to

  • 0

Consider this related question: Deep cloning objects

Is this really the best way to clone an object? (serialize/deserialize). Serialization seems a bit expensive to me.

My idea was to create a second constructor and just assign all variables. Would this approach be faster?

class Test
{

public Test(Test clone)
{
// clone ....
}
}
  • 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-05-31T08:31:22+00:00Added an answer on May 31, 2026 at 8:31 am

    If you are talking about using a custom class, the best way is to implement ICloneable. This way your class can provide a standardized way to clone itself.

    There are some times when using a ‘copy constructor’ can be better, but usually only if you can see that it would be simple, and ICloneable doesn’t meet your needs adequately.

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

Sidebar

Related Questions

Background This question is related to Why does String.valueOf(null) throw a NullPointerException? Consider the
This might be a entity framework related question, anyway, here goes: Consider the following
Consider this code... using System.Threading; //... Timer someWork = new Timer( delegate(object state) {
(this is related to another question about implementation on iPhone) I have a large
This question is rather agnostic than related to a certain version control program. Assume
This is a semi-related question to question to the following question I just raised:
This question is related with Microcontroller programming but anyone may suggest a good algorithm
I find this comes up a lot, and I'm not sure the best way
This is not a question related to a specific language, rather on the correct
This question is related to my last one . I am trying to solve

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.