I was wondering about a method of ArrayList. I have an ArrayList saved in my session and I want to search through the list for a specific element. Would using lastIndexOf() work? Would it actually search element by element until it found a match?
As you learn Java, you should spend some time learning how to navigate the Java API docs for the version of Java you are using. Notice that several of the replies above gave links directly to the documentation for the ArrayList class. If you know how to navigate the API docs, you can easily find what a method returns in certain conditions. The docs also describe how each method work, what exceptions are thrown, and what parameters a method takes. As you can see the answers you find there will save a lot of time since you won't have to wait for us here at the Ranch to answer it for you. Besides, we often have to look at the docs ourselves to find the answers.
I strongly sugest you take the time to learn about the API docs. They will help immensely as you continue to learn how to program in Java.