java二分查找拔出法。本站提示廣大學習愛好者:(java二分查找拔出法)文章只能為提供參考,不一定能成為您想要的結果。以下是java二分查找拔出法正文
package uv;
public class Bean implements Comparable<Bean> {
String sessionId;
Integer num = 1;
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Bean(String sessionId) {
this.sessionId = sessionId;
}
public void increase() {
++num;
}
@Override
public int compareTo(Bean o) {
return this.sessionId.compareTo( o.getSessionId());
}
@Override
public String toString() {
return sessionId;
}
public static void main(String[] args) {
System.out.println("b".compareTo("b"));;
}
}