Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Clone() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Clone() method" Watch "Clone() method" New topic

Clone() method

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238

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

Joined: Sep 20, 2010
Posts: 3581

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

Joined: Oct 13, 2005
Posts: 37953
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().
jQuery in Action, 2nd edition
subject: Clone() method
Similar Threads
Clone () method
Curiosity regarding the object class
what is the use of Clonable interface?
Clonable interface