Mega Code Archive

 
Categories / C# Tutorial / Class
 

Private copy constructor used when making a copy of this object

using System; public sealed class Dimensions : ICloneable {     public Dimensions( long width, long height ) {         this.width = width;         this.height = height;     }     private Dimensions( Dimensions other ) {         this.width = other.width;         this.height = other.height;     }     public object Clone() {         return new Dimensions(this);     }          private long width;     private long height; }