M
Mize-ze
I want to create an interface with two methods
The classes that will implement this interface will sometimes need the
methods with different arguments and return types. how can this be
done? what is the simpliest solution? I realize that it can be two
different interfaces but that is really not good with my design.
An example of what I want will make it clearer:
public interface MyInterface
{
public ??? foo(??? arg)
public ??? bar(??? arg)
}
public classA implements MyInterface
{
public String foo(String arg);
public String bar(String arg);
}
public classB implements MyInterface
{
public int foo(Object arg);
public String bar(Object arg);
}
Thanks.
The classes that will implement this interface will sometimes need the
methods with different arguments and return types. how can this be
done? what is the simpliest solution? I realize that it can be two
different interfaces but that is really not good with my design.
An example of what I want will make it clearer:
public interface MyInterface
{
public ??? foo(??? arg)
public ??? bar(??? arg)
}
public classA implements MyInterface
{
public String foo(String arg);
public String bar(String arg);
}
public classB implements MyInterface
{
public int foo(Object arg);
public String bar(Object arg);
}
Thanks.