I need to create an array with the following structure:
{int, String, String, int}
I want to insert this array into another array like this:
{int, String, String, int}, {int, String, String, int}, ... and so on.
I have already tried this:
Object[] vector = new Object[100];
public void inserare(int poz, int nr, String nume, String prenume, int nota){
Object[] aux = new Object[4];
aux[0] = new Integer(nr);
aux[1] = new String(nume);
aux[2] = new String(prenume);
aux[3] = new Integer(nota);
vector[poz] = aux;
}
public void afisareLista(){
for(int i = 0; i < vector.length; i++){
System.out.println(vector[i]);
}
}
Aux is inserted, but when I want to print all the elements of main array, all I get is something like this:
[Ljava.lang.Object;@15db9742
Any help for display correctly the elements is appreciated.