An implementation of Java ArrayList. More...
#include <wl.h>
Public Member Functions | |
ArrayList () | |
Constructor of ArrayList. More... | |
~ArrayList () | |
Destructor of ArrayList. More... | |
void | add (int pos) |
Add an integer into the arary. More... | |
int | get (int n) |
get the nth pos More... | |
void | print () |
An implementation of Java ArrayList.
This implementation has only add and get method. That's enough for this project.
ArrayList::ArrayList | ( | ) |
Constructor of ArrayList.
Initialized the capacity as 1.
ArrayList::~ArrayList | ( | ) |
Destructor of ArrayList.
Delete the allocated array.
void ArrayList::add | ( | int | pos | ) |
Add an integer into the arary.
pos | - new integer pos |
int ArrayList::get | ( | int | n | ) |
get the nth pos
n | - index of request the integer |
void ArrayList::print | ( | ) |