首页 > 编程 > Java > 正文

java二分查找插入法

2019-11-26 15:37:47
字体:
来源:转载
供稿:网友

复制代码 代码如下:

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"));;
}
}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表