Prev: JDK 1.5.0_21 released
Next: LWUIT and J2ME
From: Morris Keesan on 12 Sep 2009 21:53 On Fri, 11 Sep 2009 13:54:38 -0400, markspace <nospam(a)nowhere.com> wrote: > Morris Keesan wrote: > >>>> Integer i = ...; >>>> Long l = ...; >>>> assertEquals(i,l); // assertEquals is ambigous, doesnt work > >> or simply sidestep the issue by replacing the assertEquals with >> assertTrue(i == l); > > > Will that work if i and l are objects instead of primitives, as has > already been indicated? No. My apologies. I've been dealing with too many different languages, and I lose track. I was thinking of assertTrue(i.equals(l)), or assertTrue(l.equals(i)) but looking at the documentation I see that those won't work either, because Integer.equals() never returns true if its parameter isn't an Integer, and similarly for Long.equals(), so never mind. -- Morris Keesan -- mkeesan(a)post.harvard.edu |