public class ArrayIntList extends Object
Constructor and Description |
---|
ArrayIntList()
Initializes a new empty list with initial capacity of 10 integers.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int value)
Adds value to the end of the list.
|
void |
add(int index,
int value)
Inserts value into the list at index.
|
int |
get(int index)
Returns the value at index.
|
boolean |
isEmpty()
Returns true if list is empty, false otherwise.
|
void |
set(int index,
int value)
Stores value in index.
|
int |
size()
Returns the number of elements in the list.
|
String |
toString()
Returns a String representation of the list consisting of the elements
in order, separated by commas and enclosed in square brackets.
|
public ArrayIntList()
public void add(int value)
public void add(int index, int value)
public int get(int index)
public void set(int index, int value)
public int size()
public boolean isEmpty()