Java equal

public class Object
{

public boolean equals(Object o)
{
 return this==o;   
}   

}

two object references are equal
only if they are pointing to the same object.

 

可以重写equal 方法。

posted @ 2017-03-22 14:37  kakaisgood  阅读(130)  评论(0编辑  收藏  举报