Possible Duplicate:
Java Generics
To be more specific, whats the role of the <String> in the following line of code?
private List<String> item = new ArrayList<String>();
Mainly to allow the compiler to raise an error if you don't insert the right kind of data into the list or if you expect data of the wrong type from the list at the moment of extraction
But see the generics tutorial for an explanation: http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With