M
michael
To newsgroup,
<code snippet>
package folder;
import folder.Bar;
class Foo{
public static void main (String[] args){
Bar b = new Bar();
Object obj = b.clone();
Object[] array = new Object[10];
array[0] = obj;
}
}
.....
package folder;
class Bar implements Cloneable{
public Bar(){ System.out.println("creating bar object");}
}
Problem: I get a compile-time error complaining that the clone() method is
package protected. As you can see I have packaged both classes in the same
package, and therefore I should not be getting this error. What am i doing
wrong? note, I am using Java SDK 1.4
Any help appreciated
Regards
programmer
<code snippet>
package folder;
import folder.Bar;
class Foo{
public static void main (String[] args){
Bar b = new Bar();
Object obj = b.clone();
Object[] array = new Object[10];
array[0] = obj;
}
}
.....
package folder;
class Bar implements Cloneable{
public Bar(){ System.out.println("creating bar object");}
}
Problem: I get a compile-time error complaining that the clone() method is
package protected. As you can see I have packaged both classes in the same
package, and therefore I should not be getting this error. What am i doing
wrong? note, I am using Java SDK 1.4
Any help appreciated
Regards
programmer