dimanche 17 septembre 2017

I think the output of this code should be true in both cases, but the first one is false, and second one is true. I need to know why?

package test;

/** * * @author manis */ public class Test {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
Integer a = 1000, b = 1000;
System.out.println (a == b);

Integer c = 100, d = 100;
System.out.println(c == d);

}

}

Aucun commentaire:

Enregistrer un commentaire