JAVA Developer

M.Eng Tomasz Michalak
  • Home
  • O mnie
  • CV [en]

Archiwum

Posty oznaczone ‘equals’

Comparing Integer/Long/Short/Float/Double with ‘equals’ method.

maj 3rd, 2011 Tomasz Michalak 2 comments
Integer i7 = 7;
long l7 = 7L;
System.out.println(i7.equals(l7));

Wynikiem jest false.

public boolean equals(Object obj) {
	if (obj instanceof Integer) {
	    return value == ((Integer)obj).intValue();
	}
	return false;
}
Kategorie:Java Tagi:Double, equals, Float, Integer, Long, Short
RSS
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha

Random Posts

  • Arrays to Lists in Java
  • Testy jednostkowe
  • Comparing Integer/Long/Short/Float/Double with ‘equals’ method.
  • GeeCON 2010
  • Collections vs Arrays w Javie

Tag Cloud

Arrays Collections Double equals exceptions finally Float GeeCON 2010 Integer Java jdk7 Lists Long Short

Categories

  • Bez kategorii
  • GeeCON 2010
  • Java

Blogroll

  • DecoGraf.pl – dekoracje na każdą okazję
  • JUG Poznań
  • Klima-Tech.com.pl – projektowanie, montaż, serwis z zakresu wentylacji, klimatyzacji, chłodnictwa.

Archives

  • luty 2012
  • maj 2011
  • sierpień 2010
  • maj 2010

Meta

  • Zaloguj
Góra WordPress
Copyright ©2010-2012 JAVA Developer
Theme by NeoEase. Valid XHTML 1.1 and CSS 3.