Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Kane Stoboi
Kane Stoboi
21,919 Points

Arrays, Sets and Lists

I'm still a little confused about using these data types. To me they all seem to be just another way of storing an array. More so I'm not completely understanding what situations each would be best suited for and why they would be beneficial over the other data types.

If some one could explain or point me in the right direction that would be great.

1 Answer

Michael Hess
Michael Hess
24,512 Points

Hi Kane,

Arrays are cumbersome and can be difficult to deal with, so the Java Collections Framework, which includes sets, maps and lists, was made.

The javadocs are a good source to how to use packages or classes that are already built into Java. This is a link to the Java 8 javadocs: Java 8 javadocs

You may want to lookup collections in the javadoc.

This is a link to the collection framework overview: Collections Framework Overview

As you continue your Java programming journey the Java Collections Framework will begin to make more sense to you.

If you have any further questions feel free to ask! Hope this helps!

Kane Stoboi
Kane Stoboi
21,919 Points

Thanks for your reply Michael, I'll be sure to read up on those.