I have a method
public int addTransaction(Transactions tr){
//etc...
}
and now I want to create a new method, which will do exactly like addTransaction but it will take a different type object Order order.
I realise that I can create this:
public int addTransaction(Order tr){
//etc...
}
However I was wondering if I can have one method with generic type inside the parenthesis so to pass whatever object I want. Can this be done?
public class SOTest<T> {public int addTransaction(T tr){}}