import java.awt.Rectangle;
import java.util.Comparator;
public class RectangleComparator implements Comparator
{
public int compare(Object object1, Object object2)
{
Rectangle rec1 = (Rectangle) object1;
Rectangle rec2 = (Rectangle) object2;
return rec1.getWidth().compareTo(rec2.getWidth());
}
}
出于某种原因,我收到错误 double 无法取消引用。谁能帮我弄清楚为什么?