Не могу понять в чем ошибка
package com.javarush.task.task21.task2109;
import java.io.*;
/*
Запретить клонирование
*/
public class Solution {
public static class A implements Cloneable {
private int i;
private int j;
public A(int i, int j) {
this.i = i;
this.j = j;
}
public int getI() {
return i;
}
public int getJ() {
return j;
}
public Object clone(){
return new A(this.i, this.j);
}
}
public static class B extends A {
private String name;
public B(int i, int j, String name) {
super(i, j);
this.name = name;
}
public String getName() {
return name;
}
public Object clone(){
throw new CloneNotSupportedException();
}
}
public static class C extends B implements Cloneable {
public C(int i, int j, String name) {
super(i, j, name);
}
public Object clone(){
C c = new C(getI(), getJ(), getName());
return c;
}
}
public static void main(String[] args) {
}
}