求教一个小问题,看不懂......

小坏猫 小坏猫 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
不多说了,赶紧上代码,小弟菜鸟一枚,今天自己按照老师的代码照猫画虎,结果能够编译,但是没有结果输出,求大侠帮帮忙。

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

}

大侠帮帮忙,小弟感激不尽。
...全文
评论 47
收藏 已收藏
分享
返回顶部
小坏猫
Java SE 62,620 成员 307,251 内容