public class ShortCompare implements sun.misc.Compare { public int doCompare(Object o1, Object o2) { Short I1 = (Short) o1; Short I2 = (Short) o2; short i1 = I1.shortValue(); short i2 = I2.shortValue(); if (i1 > i2) return 1; else if (i1 == i2) return 0; else return -1; } } ShortCompare comp = new ShortCompare();调用
public class ShortCompare implements sun.misc.Compare
{
public int doCompare(Object o1, Object o2)
{
Short I1 = (Short) o1;
Short I2 = (Short) o2;
short i1 = I1.shortValue();
short i2 = I2.shortValue();
if (i1 > i2) return 1;
else if (i1 == i2) return 0;
else return -1; }
}
ShortCompare comp = new ShortCompare();调用