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?
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?