Buenas. Intento introducir números en un arraylist con un for, y no me da ningún error, pero cuando los imprimo por consola me muestra todo asteriscos...
Aquí está el código :
public static ArrayList<Integer> numerosCalientes = new ArrayList<Integer>();
public static int[] numSalidos = new int[37];
public static double[] porcentajeNum = new double[37];
//CALCULAR PORCENTAJE Y METERLO EN ARRAY
for(int i = 0 ; i<porcentajeNum.length;i++){
porcentajeNum[i]=(numSalidos[i]*100)/numerosTotal;
}
//CALCULAR NUMEROS CALIENTES Y METERLO EN ARRAYLIST
for(int i = 0; i<numerosCalientes.size();i++){
if(porcentajeNum[i]>4){
numerosCalientes.add(numCal);
}
}
Primero probé sin el parse y poniendo simplemente : numerosCalientes.add(i);
Pero me da el mismo resultado...
Luego para mostrarlo lo hago así (no se si está bien usado el Iterator, no lo he usado casi) :
Iterator<Integer> it = numerosCalientes.iterator();
while(it.hasNext()){
System.
out.
print(it.
next()+" - "); }
Gracias de antemano y un saludo