两个Integer对象是否 ==

其机制与String是类似的


		Integer a = 5;
		Integer b = 5; 		
		System.out.println(a == b); // true.
		
		Integer c = new Integer(5);
		Integer d = new Integer(5);		
		System.out.println(c == d); // false.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.