me fijo un bucle sin fin, cambiando Entero a int en el siguiente:Entero objetos int vs
public class IntTest {
public static void main(String[] args) {
Integer x=-1;
Integer total=1000;
while(x != total){
System.out.println("x =" + x + "total ="+ total);
x++;
}
}
}
Cuál es la razón adecuada para esto? Pensé que Integer no compararía ningún problema.
Gracias.
También podría haber cambiado "x! = Total" a "total! = X". – DJClayworth
Pago y envío http://www.javapractices.com/topic/TopicAction.do?Id=197 –