 Let's talk a little bit more about ArrayLists. First, how do you convert an array of objects into an ArrayList? Consider these two arrays of strings. The most direct way to convert to an ArrayList is a for loop. I'll create a new ArrayList of strings called ChemList, and that will be a new ArrayList. And then, for each string, chemical inside the chemical array, I'll add it to the ChemList, and let's print out the result. And there's our chemical list. Another way to do the conversion is to import java.util.arrays, notice the s at the end, and use its asList method to create a data structure to pass to the constructor. In this case, I'm going to have an ArrayList of string called PlanetList, and it's going to be a new ArrayList. Instead of empty parentheses, I'm going to call arrays.asList of PlanetArray, and let's print that out. And there are my two lists. I'm going to switch over to the java.shell to show you the rest of the things about ArrayList in this video. Here's our ChemList, and here's our PlanetList. To remove an item from an ArrayList, you use the Remove method and give an index number. That call will return the removed item. So if I say removedItems equals ChemList.RemoveTo, the removedItem is H2SO4, and that entry is indeed gone from the ArrayList. You can also give Remove an object as its argument, and the first occurrence of that argument in the list will be removed. This version of Remove will return true if something was removed successfully, false otherwise. For example, I can say removedOk equals PlanetList.RemoveMars. That's true because it was in the list, and indeed it is removed. If I say removedOk equals PlanetList.RemoveSaturn, that returns false because that wasn't in the list, and the PlanetList remains untouched. There is one situation where you can get into trouble with these two different flavors of Remove, and that's when you have an ArrayList of integers. Let's have an integer array, capital I, because I need to have objects, and we'll set an array with the numbers 32, 19, 45, 25, and 60. Then I'll create an ArrayList of integer objects, and it'll be a new ArrayList that's based on my array. If I try to remove 19 from the list by doing this, I'll get an index out of bounds exception. This call to Remove is trying to remove the 19th element of a list that has only five items in it. Java is not going to automatically box the 19 into an integer object, because an unboxed int primitive is a valid argument to remove. In this case, what I have to do is explicitly convert the primitive 19 to an integer object so that Java calls the method that I want. Removed OK equals Ageless.Remove integer.Value of 19. Now I have an integer object, and the 19 is gone from my Ageless. If your ArrayList contains anything other than integer objects, you'll never run into problems with these two different versions of the Remove method. A couple of other useful ArrayList methods contains I can ask PlanetList.Contains Earth, which returns true. PlanetList.Contains Pluto returns false. Here's a list of names, and notice that Joe is duplicated in that list on purpose. The index of returns the index of the first occurrence of an object, or negative 1 if it's not in the ArrayList. Nameless.IndexOfJoe returns 1. Nameless.IndexOfNorman, which is not in the list, returns negative 1. LastIndexOf returns the index of the last occurrence of an object, or negative 1 if it's not in the ArrayList. Nameless.LastIndexOfJoe returns 4. And again, for a name that's not in the list, returns negative 1. And those are the other things that you can do with an ArrayList.