• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt on clone() method

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Every class is extending Object class.Object is having clone() method.But we are not able to use this method without the implementation of Serializable interface.What is the reason?
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm not aware of the requirement to implement the Serializable interface, however I'm aware of requirement to implement the Cloneable interface. The Cloneable interface acts like a flag signaling (the compiler I ass u me) that your objects are prepared to be cloned.
Maybe you can check if you're referring to Cloneable. I think that StarWars III goes into more detail about the clones, comes out in may I think???
[ January 12, 2005: Message edited by: Jimmy Die ]
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Appendix A" to Bruce Eckel's Thinking in Java provides a nice treatment of cloning, and reasons for using the Cloneable interface.

http://www.faqs.org/docs/think_java/TIJ319.htm

(Scroll down to the heading, "Making Local Copies.")
[ January 12, 2005: Message edited by: marc weber ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic