public class Cat{
  private static int count; 
  private String name; 

  public Cat(String name){
    this.name=name;
    count++;
    System.out.println("创建了第"+count+"只猫："+name); 
  }

  public static int getCount(){
    return count;
  }
  
  public String getName(){
    return name;
  }

  public static void main(String args[]){
    Cat c1=new Cat("Tom");
    Cat c2=new Cat("Mary");
    Cat c3=new Cat("Mike"); 
    System.out.println("一共创建了"+count+"只猫。");
  }
}