Skip Top Navigation Bar

Analyzing an ArrayList Object

boolean contains(Object o)

This method returns true if Object o is found in the ArrayList; false otherwise.

Your Turn

Let's try it in the Java Playground.

int indexOf(Object o)

This method return the index of the first occurrence of Object o if it exists. If the ArrayList does not contain this value, the method returns -1.

Your Turn

Let's try it in the Java Playground.

boolean isEmpty()

The method returns true if there are no elements in the ArrayList and false otherwise.

Your Turn

Let's try it in the Java Playground.

Complete List of ArrayList Tutorials

Resources