Вот наш main
Test1 test1 = new Test1();
test1.clone();
Test2 test2 = new Test2();
test2.clone(test2);
Test3 test3 = new Test3();
test3.clone();
Test4 test4 = new Test4();
test4.clone();
Вот собственно наши классы:
public static class Test1 implements Cloneable {
protected Test1 clone() throws CloneNotSupportedException {
return new Test1();
}
}
public static class Test2 extends Test1 implements Cloneable{
public Test2 clone(Test2 test2) throws CloneNotSupportedException {
return new Test2();
}
}
public static class Test3 implements Cloneable{
public Test3 clone() throws CloneNotSupportedException {
return new Test3();
}
}
public static class Test4 extends Test3 implements Cloneable{
public Test4 clone() throws CloneNotSupportedException {
return new Test4();
}
Но при такой записи валидатор не принимает и пишет: "В методе main должен быть вызван метод c1one на объекте типа Test3."
В чем разница тогда между Test1 и такой же записью Test3. Совсем не понимаю, подскажите пожалуйста