This keyword in Java
•
Java
boolean isEquals(Main main){
Main m1=this;
Main m2=main;
if(m1==m2) //地址比较两个对象是否是<a href="https://www.jb51.cc/tag/yige/" target="_blank" class="keywords">一个</a>
return true;
if(m1.name.equals(m2.name) && m1.age==m2.age)
return true;
else
return false;
}
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码