I have some strange question.
I have an interface in java:
public interface Inventory{
public void add(// take an object of a class);
public int delete(// take an object of a class);
public int edit(// take an object of a class);
}
then i wrote a class that implements the interface.
public class Supply implements Inventory{
public void add( // object of some class) {}
public int edit( // object of some class) {}
public int delete( // object of some class) {}
}
then i wrote another class that implements the interface but with different object name in parentheses.
public class support implements Inventory{
public void add(// object of different class) {}
public int edit(// object of different class) {}
public int delete(// object of different class) {}
}
my question is: what is the parameter that must be written in interface methods in order to make the other classes take any object name that would like to implement in its own way.
List<T>?Product pthen this object name must be used also in all classes that implements the interface. but i have a class that needs different object name called for example:Supplier sInventory<T>with a methodvoid add(T t). Then you can have a class thatimplements Inventory<Product>with a methodadd(Product p)but you could also have a class thatimplements Inventory<Supplier>with a methodvoid add(Supplier s).