public class Animal { String name = ""; String color = ""; String kind[] = {"buru","fburu"}; public void cry(String names,String colors,String kinds[]){ this.name = names; this.color = colors; this.kind = kinds; System.out.println("那只"+colors+"的,名叫"+names+"正在叫"); } public void eat(){ } } public interface Swim(){ public void swim(){ System.out.println(""); }; }; public class Rabit extends Animal(){ Animal a = new Rabit(); a.cry("美人的兔子","黑色",kind[0]); } public class Frog extends Animal implements Swim() { Animal b = new Frog(); b.cry("大兵的青蛙","绿色","kind[1]"); b.swim() { System.out.println("虽然不是鱼,但青蛙也是游坛高手"); } }