In this challenge, you have a set of objectives to create an ArrayList of grocery items. Then, create a second list, and add the second list to the first list using the addAll method. Finally, use the contains method to search for an item and remove it if found.
(inspirational chime music)…- [Instructor] Welcome to the challenge…on the data structures.…The objective of this challenge is to…reinforce the skills that you learned…during this series.…For this challenge, start by creating…an ArrayList of grocery items.…Then, create a second ArrayList…that has some additional items.…Add the extra items to your original list,…but don't add them one at a time.…Use the add all to add the second list to the first list.…
Then, search for an item in the entire list,…and if it's found, remove that item.…For this challenge, I'm estimating…it'll take about 10 minutes.…When you're done, come back and watch the solution video.…There, I'll show you the thought process…that I use to accomplish this task.…
In this course, explore data structures in the Java language. Follow Peggy Fisher as she introduces you to several types of commonly-used data structures in Java. Peggy explores ArrayLists and LinkedLists, both of which implement the List interface, which extends the Collection interface and allows you to access list elements in a specific order. She also goes into the Vector, Stack, and Queue collection classes. To help you better understand these new concepts, Peggy wraps up the course with a challenge—creating a grocery list—and provides a solution for that challenge.
- Reviewing the types of data structures
- Working with the Collection interface and Iterable interface
- Working with ArrayLists and LinkedLists
- Using the Vector, Stack, and Queue collection classes