hi all,
I'm not getting why this code is giving error.
class CloneTest1
{
public static void main(
String s[])
{
Tree tree = new Tree();
Tree tree1 = (Tree)tree.clone(); //////////!!! this line is
giving error
}
}
class Tree implements Cloneable
{
String name = "name";
}
the error is
CloneTest1.java:7: Can't access protected method clone in class
java.lang.Object
. Tree is not a subclass of the current class.
Tree tree1 = (Tree)tree.clone();
pls. help me out.
regards
deekasha