M
mark13.pl
Hello,
I have a class:
public class MyList<T> implements MyListInterface<T> {
public void add(T elem) { ... }
public T get(int i) { ... }
}
In main program I create:
MyList[] list = new MyList[10];
for (i = 0; i < 10; i++) {
list = new LinkedList<Data>();
list.add(data);
}
getting a warning: "Type safety: The method add(Object) belongs to the
raw type MyList. References to generic type MyList<T> should be
parametrized."
Could you expain me how can I handle with that warning??
Regards, mark
I have a class:
public class MyList<T> implements MyListInterface<T> {
public void add(T elem) { ... }
public T get(int i) { ... }
}
In main program I create:
MyList[] list = new MyList[10];
for (i = 0; i < 10; i++) {
list = new LinkedList<Data>();
list.add(data);
}
getting a warning: "Type safety: The method add(Object) belongs to the
raw type MyList. References to generic type MyList<T> should be
parametrized."
Could you expain me how can I handle with that warning??
Regards, mark