> Thomas, what did you mean by there is less need to directly use
> reference arrays.
Ths significant advantage of reference arrays over List, is that the
type information of the elements is kept in the former (more or less).
With generics that advantage disappears. All you are left with is a
slightly better syntax, an indication that you cannot structurally alter
the container and a tiny (usually negligible) performance improvement.
> Also, the solution I discovered to Type my ArrayLists was:
> ArrayList<JBoid>[][] grid = (ArrayList<JBoid>[][])new
> ArrayList[40][40];
That will add lint to your code. You can sweep it under the carpet with
@SuppressWarnings. But there is no need.
It's a pity that that technique is used in the implementation of
collections, IMO. Even there an object that matches the erasure, but not
the generic parameter, is forced.
> At least I think that's what I used. I ended up taking it out because
> to be honest I wasn't worried with accidentally adding the wrong type
> and was okay with casting the objects.
For my money, the main advantage of generics is about eliminating the
possibility of certain classes of bug, although that isn't a bad thing.
They are about documentation. Taken an instance at a time, casting might
make sense. Over any significant collection of code, I find untyped
collection a nightmare.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Veleek - 04 Dec 2005 20:37 GMT
Okay guys,
Just wanted to say thanks again for all your help and pointing me in
the right direction.