Esempio n. 1
0
  public static void main(String[] args) {
    Animal animal = new Animal("Animal", 1, 1, 5, 5); // definition for a base Animal

    Dog dog = new Dog("Yorkie", 8, 20, 2, 4, 1, 20, "long silky"); // initializing a Dog
    dog.eat();
    dog.walk();
    dog.run();
  }
  public static void main(String[] args) {

    SuperClass superclass = new SuperClass();
    Bird bird = new Bird();
    Dog dog = new Dog();
    System.out.println();
    superclass.sleep();
    superclass.eat();
    bird.sleep();
    bird.eat();
    dog.eat();
    dog.sleep();
  }