public interface foo {
String ex(String a);
}
public class myclass implements foo {
public String ex(String a) {
//define the method
return a;
}
public static foo getsome() {
//have to return for example if I do ex("abc") return "123" but have to retrun the object of the interface o.O
}
}
I don't know how to return an object of an Interface because I know that an object of interface cannot be implemented. On the other side, get methods of the all commands has no input. So what can I do?