模仿的一天
作者:互联网
public interface PetOutput{
void sound();
}
public class Dog implements PetOutput{
private String name;
private String breed;
public Dog (String aName){
name=aName;
breed="哈巴犬";
}
public Dog (String aName, String aBreed){
name=aName;
breed=aBreed;
}
public void training(){
System.out.println("汪汪汪汪汪......");
}
public String toString(){
return"它的名字"+name+",它是"+breed;
}
}
标签:一天,name,breed,Dog,aName,public,模仿,String 来源: https://www.cnblogs.com/l2760186162/p/10752738.html