public class return2 {
public static void main(String[] args) 

Cat c1 = new Cat(1,2,3); //实例化
Cat c2 = new Cat(1,2,3); 
System.out.println(c1.equals(c2)); 


class Cat { 
int colour; 
int height,weight; 
public Cat(int colour,int height,int weight) { 
this.colour = colour;  //使用全局变量
this.height = height; //使用全局变量
this.weight = weight; //使用全局变量

public boolean equals(Object obj) { 
if (obj==null) return false; 
else 
if(obj instanceof Cat) { 
Cat c = (Cat)obj; 
if((c.colour==colour)&&(c.height==height)&&(c.weight==weight)) { 
return true; 


return false; 
} }这个句子应该怎么理解啊,请能够详细点说明一下步骤,谢谢。