In the example below I have a class in java that will fetch data from a certain excel file. All this part of fetching the file the program does, but now needed that this data be stored in an array. I do not know how to do it.
public class UniFederal {
public static void main(String[] args) throws IOException{
List<List<String>> vecSample = new ArrayList<List<String>>();
double[] vect;
int [][]matriz = new int[30][30];
String[][] referencia = new String[][];
File excel = new File("gestaoAlunos.xlsx");
FileInputStream fich = new FileInputStream(excel);
XSSFWorkbook workbook = new XSSFWorkbook(fich);
XSSFSheet sheet = workbook.getSheetAt(0);
Iterator<Row> rowIt = sheet.iterator();
while(rowIt.hasNext()){
Row row = rowIt.next();
int i=0, j=0;
Iterator<Cell> cellIterator = row.cellIterator();
while(cellIterator.hasNext()){
Cell cell = cellIterator.next();
System.out.print(cell.toString() + ";");
//System.out.print(vecSample.get(i));
i++;
}
System.out.println();
}
workbook.close();
fich.close();
}
}