Allora ho questo metodo creaLista() che mi dovrà restituire un array di stringhe, a questo passo un ResultSet e un tipo. Vorrei poi che l'array che dovrebbe restituirmi sia visibile a tutta la classe e abbia ogni volta come nome il valore di tipo passato precedentemente in input.

ad es.
creaLista(rs1, tipo1);
creaLista(rs2, tipo2);

dovrebbe darmi 2 array uno che si chiama tipo1 e un altro tipo 2.

Le domande sono 2 quindi:
1) Come realizzo quello che ho detto sopra;
2) Dove và messo il return (visto che mi dà errore di missing return statement)

codice:
    private String[] creaLista(ResultSet cursore, String tipo) { 
            try {
            cursore.last();
            int numRows = cursore.getRow();
            cursore.beforeFirst();
            int i = 0;
            String[] lista = new String[numRows];
            
                while(cursore.next()) {   
                   lista[i] = cursore.getString(tipo);
                   i++;
                }
            
            } catch (SQLException e) {
                alerts.showErr(e.getMessage());
            }   
    }