Hi,
I am new java. I have a probelm adding objects to list. This is the following code.
class Test{
List <>dataList = new ArrayList<>();
public List<A> getAList(){
dataList.add(new A());
return dataList ;
}
public List<B> getBList(){
dataList.add(new B());
return dataList;
}
}
In the above code what I will pass<parameterized data> to the dataList decalred as member variable?