Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java ArrayList

Name: Anonymous 2009-08-29 0:52

Oh hai
I'm kinda new to programming (I've used Scheme, a little BASIC, and Python) and am trying to learn Java.
When I try to implement an ArrayList class, eclipse indicates that I should have the syntax "Arraylist<E>()". I know the () brackets can be empty, but what is the purpose of the <> brackets? I thought it was a type specification, but when I put in my type 'Record' into there, and attempt the following:
ArrayList records = new ArrayList<Record>();
//stuff
//new method
return records.get(0).text(); //text is a valid method of Record
it seems to think that the return type of .get(0) is a generic Object.

Wut happin?

Name: Anonymous 2009-08-29 1:14

>>4
Whoops, sorry, meant "use" the ArrayList, lol.
But yeah, I just want to know what those <> brackets do.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List