java二分查找插入法
程序员文章站
2024-02-23 16:13:34
复制代码 代码如下:package uv;
public class bean implements comparable ...
复制代码 代码如下:
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"));;
}
}