Why this code generates Warnings ?

This code is a example:

ArrayList<Object> al =new ArrayList<Object>();

Object[] objArray =new Object[100];

objArray[0] = al;

ArrayList<Object> al2 = (ArrayList<Object>)objArray[0];

Why line

ArrayList<Object> al2 = (ArrayList<Object>)objArray[0];

generates Warnings ?

and how can I remove them ?

Thkx

[447 byte] By [pbulgarellia] at [2007-11-27 10:59:15]
# 1

The array is the cause. Read what this tutorial has to say about using arrays with generics.

http://java.sun.com/docs/books/tutorial/extra/generics/fineprint.html

ChuckBinga at 2007-7-29 12:21:47 > top of Java-index,Core,Core APIs...
# 2

Thanks,

I'll take a look.

pbulgarellia at 2007-7-29 12:21:47 > top of Java-index,Core,Core APIs...