R
Ross
Let's say that I have a java.util.ArrayList which will contain only
strings. So, I can declare this as:
ArrayList<String> blah = new ArrayList<String>();
So far so good, but let's say that blah is an array in itself. I'd
expect to be able to do this:
ArrayList<String> blah[] = new ArrayList<String>[ 50 ];
However, if I do that, I get a compile time error saying something
about creating a generic array. If I modify the code to:
ArrayList<String> blah[] = new ArrayList[ 50 ];
Then, it compiles and works, but gives me a warning about using a
deprecated blah blah blah.
What gives?
strings. So, I can declare this as:
ArrayList<String> blah = new ArrayList<String>();
So far so good, but let's say that blah is an array in itself. I'd
expect to be able to do this:
ArrayList<String> blah[] = new ArrayList<String>[ 50 ];
However, if I do that, I get a compile time error saying something
about creating a generic array. If I modify the code to:
ArrayList<String> blah[] = new ArrayList[ 50 ];
Then, it compiles and works, but gives me a warning about using a
deprecated blah blah blah.
What gives?