• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object clone()

 
Brett Anthoine
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm trying to get an exact copy of an object's instance. example

The problem is the compiler says clone() is protected. I'm confused.
 
Vijay Kashyap
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Brett,
You have to supply cloning method for your TestClass.
As the clone method is protected in Object class which is your super class( if you are not extending any other class in TestClass) hence you cannot use clone method without providing definition for it.
Regards,
Vijay
[ May 22, 2002: Message edited by: vijay kashyap ]
 
Brett Anthoine
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you vijay.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic