****建個資料夾擺所有的檔案(17個)
file1
interface Swimmer{
void swim();
}
file2
public class Fish implements Swimmer{
protecred String name;
public Fish(String name){
this.name=name;
}
public String getName(){
return name;
}
public void swim(){
}
}
public class Anemonefish extends Fish{
Anemonefish(String name){
super(name);
}
public void swim(){
System.out.printf("小丑魚%s 游泳%n",name);
}
}
沒有留言:
張貼留言