-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
El problema que hay en el método getSize() siguiente:
public Integer getSize() {
Integer sizeTotal = 0;
for(int i=0;i<objetosEnMochila.size();i++){
for(int j=1; j<objetosEnMochila.size();i++){
if(objetosEnMochila.get(i).equals(objetosEnMochila.get(j))){
// Sentencia vacia debido a que no se hace nada en esta condición
} else {
sizeTotal++;
}
}
}
return sizeTotal;
}
Es que no se si funciona, lo que debería realizar es contar el número de
elementos sin repetir del objeto objetosEnMochila, y posible un doble for de i
y j, puede que no lo haga funcionar
Este no es un error esencial, pero me gustaría saber si funciona de verdad, y
si hay alguna otra solución, y que me han dicho que se podría arreglar con
set, pero no se como hacerlo
Original issue reported on code.google.com by luisillo...@gmail.com on 18 Nov 2010 at 2:39
Attachments:
Reactions are currently unavailable