-2
的Java对象进行排序你好
我想我已经学会了如何在Java对象使用比较请看看下面我的代码,看看,如果我在正确的轨道使用比较
public class Books{
private String bookName;
private String bookDesc;
private int quantity;
public Books(String bookName, String bookDesc, int quantity) {
super();
this.bookName = bookName;
this.bookDesc = bookDesc;
this.quantity = quantity;
}
public String getbookName() {
return bookName;
}
public void setbookName(String bookName) {
this.bookName = bookName;
}
public String getbookDesc() {
return bookDesc;
}
public void setbookDesc(String bookDesc) {
this.bookDesc = bookDesc;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
}
您忘了发布内容吗?你只发布了一个POJO类型。 – 2014-11-02 18:23:50
这是Stackoverflow而不是[CodeReview](http://codereview.stackexchange.com/)。在那里尝试。 – Tom 2014-11-02 18:29:01
基于哪个领域你想排序类图书的对象 – AsSiDe 2014-11-02 18:29:20