comp 5 Flashcards
Another well-known data structure of Java is the ___
arraylist
is a basic functionality provided by Java
array
______ is a class of Java Collections framework.
ArrayList
arraylist belongs to
java.util package.
An ArrayList is a ______, where items can be added and removed from the list.
dynamic data structure
An ArrayList is a dynamic data structure, where _____
items can be added and removed from the list.
ArrayList cannot store _______; it can only store _____
primitive types
objects of the same type.
Syntax on creating an instance of ArrayList:
ArrayList<Type> variable = new ArrayList<Type>();</Type></Type>
to insert elements
add() method
to access an item.
get() method
to change an item.
set() method
to remove an item.
remove() method
to get the size of the arraylist
size() method
These are some ways in iterating inside an arraylist:
for-loop
enhance for-loop
Iterator class
Use the ____ method in the for-loop
get() and size()