What does < and > mean in "List<String>"?
Anyone familiair with this line:
List<String> list =new ArrayList<String>(c)
what does the "<String>" part precisely mean? I've been through the documentation, but I've not been able to find out what those "<" and ">" represent. Now I know that brackets ("[ ]") are used for arrays, but I doubt wether it's an principal equallity.
So if someone knows its true meaning and/or has a nice URL for me to glance through some nice documentation...
Thanks in advance!
Tensos
[565 byte] By [
Tensosa] at [2007-10-2 8:15:24]

So I see now.. it's all about Generics here.
Thanks for the URL! ... took a glance through it. And immediatly I saw a small, though true advantage of using generics; no casting required.
Now it's just a bit of getting used to the new syntax (hope Java won't get too creapy freaky coded :P) and view the conditions and rules of generics for usage.
> too late, it already did
... seeing the code below (encountered in the general documentation), I'm afraid you're right...
Object[] toArray();
<T> T[] toArray(T[] a);
An extra functionality is fine with me, but it is a pity that it doesn't make the code more easy readible (yet).
> > too late, it already did
>
> ... seeing the code below (encountered in the general
> documentation), I'm afraid you're right...
>
> Object[] toArray();
> <T> T[] toArray(T[] a);
>
> An extra functionality is fine with me, but it is a
> pity that it doesn't make the code more easy readible
> (yet).
It's easy to read once you get used to it, and I don't know how they would have been able to add generics with a syntax which is easier to understand, and yet is compact.
Kaj
kajbja at 2007-7-16 22:13:02 >

> An extra functionality is fine with me, but it is a
> pity that it doesn't make the code more easy readible
> (yet).
That's still easy to read, it's when you get to things like "class Foo<E extends Comparable><? super E>>" that things get a little awry...
Kaj makes a good point, though
Yeah, the code filter has been broken for generics since they last screwed up a release for the forum software.
I like generics. Writing Generified classes is the exception rather than the rule, and the type-safety of collections is pretty neat. But then I'm a heretic 'cos I like autoboxing too.
Dave.