Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Data Structures!
You have completed Java Data Structures!
Preview
A `java.util.Set` interface does not allow for duplicates. There is also `SortedSet` which allows for custom sorts and adds new methods for getting different ranges of the items.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
it would definitely be doable,
but just be a little icky.
0:00
We could create a new list
named Unique Directors
0:03
and loop over this list of all directors
and start adding them over.
0:07
And each time we're about to add one,
we first check
0:11
if the new unique list already contains
the one we're about to add.
0:13
And if it does, we don't add it.
0:17
And there's got to be a better way, right?
0:19
Well, of course there is.
0:23
Could you imagine running
0:24
something that over thousands
and thousands of pieces of data?
0:25
That would be ridiculous.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up