
Signature
Daniel Dyer
http://www.dandyer.co.uk
>> Could you expain me how can I handle with that warning??
>
> MyList<Data>[] list = new MyList<Data>[10]
Not going to work.
The "main program" should be something like:
List<MyList<Data>> list = new ArrayList<MyList<Data>>();
for (Data element : data) {
LinkedList<Data> sublist = new LinkedList<Data>(); // not java.util
sublist.add(element);
list.add(sublist);
}
With generics, you can (mostly) leave reference arrays behind.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Daniel Dyer - 19 Sep 2006 20:26 GMT
>>> Could you expain me how can I handle with that warning??
>> MyList<Data>[] list = new MyList<Data>[10]
>
> Not going to work.
Yep, forgot about that. You'd have to use an unchecked cast, but your
suggestion to use lists is probably more suitable.
Dan.

Signature
Daniel Dyer
http://www.dandyer.co.uk