---
title: "Copy Constructor in C#"  
description: "This is the one type of constructor. A copy constructor creates an object by copying variables from another object.  for example  we pass one item obj"  
author: "Amit Singh"  
published: 2011-05-12  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/170/copy-constructor-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Copy Constructor in C#

This is the one type of constructor. A **[copy constructor](https://www.mindstick.com/blog/11103/creating-a-copy-constructor)** creates an object by copying [variables](https://www.mindstick.com/articles/715/php-variables) from another object.\

for example\
we pass one [item](https://www.mindstick.com/forum/156564/remove-item-in-an-array-in-javascript) object to the item constructor so that the new item object has the same [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) as the old one.\
\
A **copy constructor defined as** :\

```
public Student(Student stud){name=stud.name;age=stud.age;}
```

\
the copy constructor is invoked by instantiating an object of type [Student](https://www.mindstick.com/articles/157138/student-loan-default-wage-garnishment-and-student-loan) and passing it the object to be copied.\
**example\** Student stud1=new Student(stud2);\
[Now](https://yourviews.mindstick.com/view/81402/it-s-liberals-vs-progressives-in-us-politics-now), stud1 is a copy of stud2.

---

Original Source: https://www.mindstick.com/blog/170/copy-constructor-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
