Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Animal {
- public final String name;
- public Animal(String name){
- this.name = name;
- }
- // よく考えたら、全てのアニマルがwalkできるとは限らない。
- /*
- public void walk(){
- System.out.println(name + " walk.");
- }
- */
- // アニマル共通の鳴き声は存在しない。
- // (アニマルというのは、抽象的なもの定義に過ぎず実態を持たない。)
- public abstract void cry();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement