filmov
tv
C# S2E3 : ICloneable - Clone Custom Object
Показать описание
In our last ICloneable tutorial, last week, we had seen how to Clone an array. Before that we had just cloned a simple string variable.
In this class now we will clone a custom Object. We first define the class which will be blueprint for the object.
ICloneable is an interface that provides cloning support to objects. To clone something is to copy something.
ICloneable typically has only a single method called, clone(). It is this method that we use to clone objects.
Let's go.
In this class now we will clone a custom Object. We first define the class which will be blueprint for the object.
ICloneable is an interface that provides cloning support to objects. To clone something is to copy something.
ICloneable typically has only a single method called, clone(). It is this method that we use to clone objects.
Let's go.