This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

clone() not visible ??

 
henry wu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to use the clone() method and I'm getting this error message :
The method clone() from the type java.lang.Object is not visible.
I'm added the "implements Cloneable" to the base class and the subclass of the object created. Any suggestions?
Henry
 
henry wu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to add that in the class that I'm trying to clone I have :
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
I'll try replacing return super.clone(); with some code and see what happens.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic