09. ArrayList (1)
09. ArrayList (1)
Topic: ArrayList
Introduction
• Standard Java arrays are of a fixed length.
boolean add(Object o)
• Appends the specified element to the end of this list.
boolean remove(Object o)
• Removes the first specified object present in the arraylist.
int size()
• Returns the number of elements in the list.
boolean contains(Object o)
• Returns true if this list contains the specified element.
int indexOf(Object o)
• Returns the index in this list of the first occurrence of the specified
element, or -1 if the List does not contain the element.
int lastIndexOf(Object o)
• Returns the index in this list of the last occurrence of the specified
element, or -1.
Let’s Do Something…