interface Creature {
    
}

class Cow implements Creature {
  void howLong() {
    System.out.println("I am a cow and I live 15 years on average.");    
  }
}

class Dolphin implements Creature {
  void howLong() {
    System.out.println("I am a dolphin and I live 40 years on average.");    
  }
}

class Fish implements Creature {
    
}

class Guppy extends Fish {
  void howLong() {
    System.out.println("I am a guppy and I live 2 years on average.");    
  }
}

class Bass extends Fish {
  void howLong() {
    System.out.println("I am a bass and I live 16 years on average.");    
  }
}

import java.util.*; 

public class One {
  public static void main(String[] args) {
    Object[] pets = new Object[4];
    pets[0] = new Cow();
    pets[1] = new Dolphin();
    pets[2] = new Guppy();
    pets[3] = new Bass();
    System.out.println( Arrays.toString( pets ) );
    for (Object a : pets) {
      a.howLong(); 
    }
  }
}

But this doesn't work because of dynamic method lookup. 

So we modify as follows: 

interface Creature {
  void howLong(); 
}

class Cow implements Creature {
  public void howLong() {
    System.out.println("I am a cow and I live 15 years on average.");    
  }
}

class Dolphin implements Creature {
  public void howLong() {
    System.out.println("I am a dolphin and I live 40 years on average.");    
  }
}

interface Fish extends Creature {
    
}

class Guppy implements Fish {
  public void howLong() {
    System.out.println("I am a guppy and I live 2 years on average.");    
  }
}

class Bass implements Fish {
  public void howLong() {
    System.out.println("I am a bass and I live 16 years on average.");    
  }
}

and the class that has the main: 

import java.util.*; 

public class One {
  public static void main(String[] args) {
    Creature[] pets = new Creature[4];
    pets[0] = new Cow();
    pets[1] = new Dolphin();
    pets[2] = new Guppy();
    pets[3] = new Bass();
    System.out.println( Arrays.toString( pets ) );
    for (Creature a : pets) {
      a.howLong(); 
    }
  }
}

Now the last part: all creatures have names. 

abstract class Creature {
  String name;
  Creature(String name) {
    this.name = name;     
  }
  abstract void howLong(); 
}

class Dolphin extends Creature {
  Dolphin(String name) {
    super(name);    
  }
  public void howLong() {
    System.out.println("I am a dolphin and I live 40 years on average.");    
  }
}

class Cow extends Creature {
  Cow(String name) {
    super(name); 
  }
  public void howLong() {
    System.out.println("I am a cow and I live 15 years on average.");    
  }
}

abstract class Fish extends Creature {
  Fish(String name){
    super(name); 
  }
}

class Guppy extends Fish {
  Guppy(String name) {
    super(name);     
  }
  public void howLong() {
    System.out.println("I am a guppy and I live 2 years on average.");    
  }
}

class Bass extends Fish {
  Bass(String name) {
    super(name);     
  }
  public void howLong() {
    System.out.println("I am a bass and I live 16 years on average.");    
  }
}

import java.util.*; 

public class One {
  public static void main(String[] args) {
    Creature[] pets = new Creature[4];
    pets[0] = new Cow("Clarabelle");
    pets[1] = new Dolphin("Flipper");
    pets[2] = new Guppy("Riddick");
    pets[3] = new Bass("Adele");
    System.out.println( Arrays.toString( pets ) );
    for (Creature a : pets) {
      a.howLong(); 
    }
  }
}

That's almost all you have to do. 

Please modify howLong() in each class to report the name. 

--