5
I have to save the row, column and contents of a spreadsheet. For this I created a two-dimensional matrix. My difficulty is how to initialize it? I believe the statement is no longer correct because I receive ArrayIndexOutOfBoundsException
. In this situation, matrix is the appropriate data structure?
if ("Veículo".equals(cell.getStringCellValue())) {
String[][] referencia = new String[][];
for (int i = cell.getColumnIndex(); i < 4; i++) {
referencia[cell.getRow().getRowNum()][cell.getColumnIndex()] = cell.getStringCellValue();
}
}
you need to specify the size of the array in the
new String[][]
– Marciano.Andrade