Lets say I have this class:
public abstract class AbstractFoo implements Cloneable {
public abstract Object clone();
}
And the subclass:
public class Foobar extends AbstractFoo {
@Override
public Object clone() {
try {
Foobar c = (Foobar) super.clone();
/* some operations */
return c;
} catch (CloneNotSupportedException e) {
throw new InternalError();
}
}
}
I know this is not possible, but I think you understand what I want. The subclass would work if Foobar implemented Cloneable and did not extend AbstractFoo. I think what I would want but is not allowed is this:
Foobar c = (Foobar) super.super.clone();
The subclass would work if Foobar implemented Cloneable and did not extend AbstractFoo.
How could I do "the same" but with the extended abstract class?