Java : Why Clone Cloning cloned. Why Java Programmers prefer cloning ? We talk about the benefits of Java Cloning. constructors are expensive , cloning is just copying the bits and bytes of the object that was created.
Though we didn't discuss in our video, pretend you want to type each and each word in a word document. Would you type each and every word, or just duplicate the file? you may say it depends on the size of the document. If the constructor is small, then you may not want to clone. If the constructor involves lot of computations such as database access or downloading information from elsewhere, then cloning is better.
Tags: Java : Why Clone Cloning cloned