`
文章列表
public class BinaryChop { private int a[]; private int nElements ; public int find(int searchKey){ int lower = 0; int upper = nElements -1; int curIn; while(true){ curIn = (lower + upper)/2; if(a[curIn] == searchKey){ return curIn; }else if(lower > upper) ...
我们都知道所有的类都从Object继承了equals()和hashcode(),先来看看equals(),和hashcode()在Object中的实现: public boolean equals(Object obj) { return (this == obj); } public native int hashCode(); 可以知道equals比较的实际是引用的地址,hashcode ...
Global site tag (gtag.js) - Google Analytics