Skip to content
Java List and ArrayList
Profile icon

Hi guys,
is there any difference between these two ways?

List wordlist = new ArrayList <> ();


ArrayList wordlist = new ArrayList ();

You are viewing a single comment. View All
Answered by hellooneplus [earned 5 cycles]
View Answer
Profile icon


List is abstract, so you can change it's 'type'. ArrayList is not, but it will allow you more speed if you know all your types are going to be the same.

Which one to use?

I have always used ArrayList, and have never found any need for List.