I want to create a mutli dimensional array without a fixed size.
I need to be able to add items of String[2]
to it.
I have tried looking at:
Create the ArrayList like ArrayList action
.
In JDK 1.5 or higher use ArrayList
reference name.
In JDK 1.4 or lower use ArrayList
reference name.
Specify the access specifiers:
Then specify the reference it will be assigned in
action = new ArrayList();
In JVM new
keyword will allocate memory in runtime for the object.
You should not assigned the value where declared, because you are asking without fixed size.
Finally you can be use the add()
method in ArrayList. Use like
action.add(new string[how much you need])
It will allocate the specific memory area in heap.