Good evening. I'm working on a program that writes a text. Basically it is composed of a Text object which is a list of Paragrafo objects, which is a list of Sentencas objects which is a list of Words objects that are a list of Strings.
I'm trying to build a method, which saves this text before any changes are made to it. Obviously I started trying to make a text-type vector that stores the text before it is changed, but because it is an object, when I make any changes in the text by another method, the one that is saved inside the vector is also changed. >
I have researched and found this one of Deep Copy, which makes a kind of cloning of the object, thus not making a reference to it as the vector does, but rather allocating in memory a copy of the object, so the changes will not effects in this copy.
But I do not understand how to implement this copy. Could someone help me? Hugs.