Is there a way to simplify this code? I tried iterating around just one for loop, converting the loop variable into a String and concatenating it with the variables arreglo2, 3 and 4; but it doesn't work. It doesn't even allow me to concatenate the variables ...
Indice = 0;
System.out.println("\nAge Range from 20 to 29\n");
for ( x = 0 ; x < arreglo2.length ; x++)
{
indice = x + 1;
System.out.println(indice + ". " + arreglo2[ x ]);
}
indice = 0;
System.out.println("\nAge Range from 30 to 39\n");
for ( x = 0 ; x < arreglo3.length ; x++)
{
indice = x + 1;
System.out.println(indice + ". " + arreglo3[ x ]);
}
indice = 0;
System.out.println("\nAge Range from 40 to 49\n");
for ( x = 0 ; x < arreglo4.length ; x++)
{
indice = x + 1;
System.out.println(indice + ". " + arreglo4[ x ]);
}
Thanks a bunch...