求教一个小问题,看不懂......
不多说了,赶紧上代码,小弟菜鸟一枚,今天自己按照老师的代码照猫画虎,结果能够编译,但是没有结果输出,求大侠帮帮忙。
大侠帮帮忙,小弟感激不尽。
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);
}
}
大侠帮帮忙,小弟感激不尽。
...全文


Java SE
