Class Clone « Class Definition « Java Articles

Java Articles
1. Class Definition
2. Data
3. Development
4. GUI
5. J2EE
6. J2ME
7. JavaBeans
8. Language
9. Microsoft Collabration
10. Network
11. Swing
12. System Resource
13. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java Articles » Class Definition » Class Clone 
1. An alternative to the deep copy technique
Author:Dave Miller
URL:http://www.javaworld.com/javaworld/javatips/jw-javatip76.html?
Summary: If you ever have a complex object that contains a number of other objects, and want to implement a deep copy -- a copy of the object and the objects to which it refers -- you know you're in for a painful and time-consuming task. This is because the default behavior of an object's clone() method automatically yields a shallow copy (a copy that excludes contained objects) -- so, to achieve a deep copy, classes must be manually edited or extended. If an object has a complex graph, then this process will result in an extensive coding effort. The technique presented in this article is a simple alternative to this difficult procedure, and takes advantage of functionality provided by serialization. (2,000 words)


2. Attack of the clones
Author:Vladimir Roubtsov
URL:http://www.javaworld.com/javaworld/javaqa/2003-01/02-qa-0124-clone.html
Summary: Time and space considerations in four different approaches to implementing deep clone() methods


w_w___w.__j__a__v__a_2_s___._c_om___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.