YES!!It's works!!
But there is an error inside the Add function. It should be getNumRows() rather than getRow() if I'm not mistaken and the ensureCapacity() function will cause an error if it's...
Type: Posts; User: FongChengWeng
YES!!It's works!!
But there is an error inside the Add function. It should be getNumRows() rather than getRow() if I'm not mistaken and the ensureCapacity() function will cause an error if it's...
After I created the ArrayList2d (list), why list.Add("String", 0) (function in the ArrayList2d class) cause an error.(Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0...
copeg, javapenguin, thanks for help and suggenstion!!
Can I ask, can we use 2d ArrayList to create N x N matrix?
<the code show below was copied from this forum>
import java.util.ArrayList;
public class ArrayList2d<Type>
{
ArrayList<ArrayList<Type>> array;
public ArrayList2d()
{