This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to correctly override clone method in Java

 
Javin Paul
Ranch Hand
Posts: 295
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clone() method is one of those details of Java, which is most criticized but same time most overlooked as well. If you have to use clone() method or have to work on a project which is already using clone() than it become even more important to understand every subtle details of clone() method in Java. I have recently shared my experience on How to correctly override clone method in Java, which includes some basics of How cloning works, some bits on deep cloning and shallow cloning and some best practices while overriding clone method in Java. Let me know how do you find it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic