you can use an array list:
ArrayList<object> arr= new ArrayList<object>();
or using a regular array:
object[] arr= new object[size];

and then for an array its pretty much the same as C++ and...