Java无法取消引用int

img


错误地方:


  //编号属性排序。比较器用匿名类实现
 public  ArrayList<Queshu> listsort2() {
        ArrayList<Queshu> all = list();
      //排序        
         all.sort(new Comparator<Queshu>(){  
            
             public int compare(Queshu o1,Queshu o2){ return (o1.getQuesuid().compareTo(o2.getQuesuid())); }
         });   
        return all;
    }

package vo;

/**
 *
 * @author Administrator
 */
public class Queshu {
    private int quesuid ;//编号
    private String shu_name;//缺书书名
    private String banshe;//缺书出版社
    private String zuozhe;//作者
    private String chuban_date;//出版日期
    private String ISBN;//书号
    private String liuyan;//留言
    private String user;//用户名
    private String time;//登记时间

    public Queshu() {
    }

    public Queshu(int quesuid, String shu_name, String banshe, String zuozhe, String chuban_date, String ISBN, String liuyan, String user, String time) {
        this.quesuid = quesuid;
        this.shu_name = shu_name;
        this.banshe = banshe;
        this.zuozhe = zuozhe;
        this.chuban_date = chuban_date;
        this.ISBN = ISBN;
        this.liuyan = liuyan;
        this.user = user;
        this.time = time;
    }

    public int getQuesuid() {
        return quesuid;
    }

    public void setQuesuid(int quesuid) {
        this.quesuid = quesuid;
    }

    public String getShu_name() {
        return shu_name;
    }

    public void setShu_name(String shu_name) {
        this.shu_name = shu_name;
    }

    public String getBanshe() {
        return banshe;
    }

    public void setBanshe(String banshe) {
        this.banshe = banshe;
    }

    public String getZuozhe() {
        return zuozhe;
    }

    public void setZuozhe(String zuozhe) {
        this.zuozhe = zuozhe;
    }

    public String getChuban_date() {
        return chuban_date;
    }

    public void setChuban_date(String chuban_date) {
        this.chuban_date = chuban_date;
    }

    public String getISBN() {
        return ISBN;
    }

    public void setISBN(String ISBN) {
        this.ISBN = ISBN;
    }

    public String getLiuyan() {
        return liuyan;
    }

    public void setLiuyan(String liuyan) {
        this.liuyan = liuyan;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "Queshu{" + "quesuid=" + quesuid + ", shu_name=" + shu_name + ", banshe=" + banshe + ", zuozhe=" + zuozhe + ", chuban_date=" + chuban_date + ", ISBN=" + ISBN + ", liuyan=" + liuyan + ", user=" + user + ", time=" + time + '}';
    }
    
}

Queshu 里面的 quesuid 是 int 类型吗?如果是,换成 return o1.getQuesuid() - o2.getQuesuid();
并且第7行添加 @Override