62,615
社区成员
发帖
与我相关
我的任务
分享
public class Cat {
/**
* @author
*/
private String color;
private int height;
private int weight;
Cat(String color,int height,int weight){
this.color=color;
this.height=height;
this.weight=weight;
}
public static String Deng(Cat a,Cat b){
if(a==b){
return "C1==C2";
}else {
return "C1!=C2";
}
}
public static String EquMao(Cat c,Cat d){
if(c.equals(d)){
return "C1 Equels C2";
}else{
return "C1 is not Equels C2";
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Cat c1=new Cat("Blue",5,6);
Cat c2=new Cat("Blue",5,6);
Deng(c1, c2);
EquMao(c1, c1);
}
}