This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clone() method

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I read cloneable interface is tagging interface. Class must override Clone() metjod declaring it as public where as Clone() method declared as protected in Object class. Any ideas, suggestions, links, resources, sample code highly appreciated. Thanks in advance
 
Stephan van Hulst
Bartender
Pie
Posts: 5553
53
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you should ask more specific questions. Is there anything you don't understand?

The clone() method is very tricky. It's useful to know how it works, but you shouldn't be eager to put it to use. It breaks easily.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Effective Java™ by Joshua Bloch, page 54.
You may be able to find a sample chapter from the first edition free of charge on the net; that covers clone().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic