How to copy class

How do i copy class? I use C# in Monodevelop. I can’t use serializing techniques. Any other technique to copy class?

If your just trying to copy the data from one class to a new class you can create a Copy method in the your class. The following example just creates a new instance of the class then assigns the class’s values to the new instance and returns it.


class Test {
    string name;
    int length;
    int width;

    public Test Copy() {
        Test copy = new Test(); =;
        copy.length = this.length;
        copy.width = this.width;
        return copy;