I am trying to make my own type of list class using generics. This list can be a list of double or string. So I can call on it:
myList<Double> l1=new myList<Double>();
I am new to using generics so I am not quite sure how to achieve this. What I have so far is:
class myList<T> {
List<T>list=new List<T>();
myList(T list){
this.list=list;
}
public void add(T o){
list.add(o);
}
}
Right now it gives me the error: "cannot find symbol
List<T>list=new List<T>();