You can return a class which implements the interface and catch it as an interface.
interface InterOne{
//...methods
}
public class AnyClass implements InterOne {
public InterOne createCopy(){
return new AnyClass();
}
public AnyClass createAnotherCopy(){
return new AnyClass();
}
}
class AnyTestClass (){
public static void main(
String [] args){
AnyClass Test1 = new AnyClass();
InterOne sample = Test1.createCopy();
InterOne anotherSample = Test1.createAnotherCopy();
}
}
And same stuff goes for the abstract class Change Interface declaration to an abstract class