class Bird
{
int count;
public Bird(){}
public Bird(int count)
{
this.count=count;
}
public int getCount()
{return count;}
public void setCount()
{this.count=count;}
public void shout()
{
System.out.println("鸟叫");
}
public void appear(Amount amount)
{System.out.println("出现了"+this.count+"只");
}
class Cuckoo extends Bird
{
public Cuckoo(int count)
{this.count=count;}
public void shout()
{
System.out.println("布谷鸟布谷布谷叫!");
}
public void appear()
{
System.out.println("马上出现"+this.count+"只");
}
}
class Parrot extends Bird
{
public Parrot(int count)
{
this.count=count;
}
public void shout()
{
System.out.println("鹦鹉学人家说话!");
}
public void appear()
{
System.out.println("看,出现了!"+this.count+"只");
}
}
class Test
{
public static void main(String[] args)
{
Cuckoo cuckoo=new Cuckoo(6);
cuckoo.shout();
cuckoo.appear();
Parrot parrot=new Parrot(6);
parrot.shout();
parrot.appear();
}
}