• Post Reply Bookmark Topic Watch Topic
  • New Topic

Clone() method  RSS feed

 
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
 
Saloon Keeper
Posts: 8237
144
  • 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.
 
Marshal
Posts: 57276
175
  • 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().
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!