2 ms·
No, you can't. In particular -1 * Integer.MIN_VALUE == Integer.MIN_VALUE.
by cdman 12y ago
No, you can't. In particular -1 * Integer.MIN_VALUE == Integer.MIN_VALUE.
- organsnyder 12y agoThat would probably never matter in practice, though—I've rarely seen compareTo() return anything other than -1, 0, or 1; certainly never anything approaching MAX/MIN_VALUE. Still, bravo for considering all of the edge cases.