public class Animal { public Animal(String theBreed) { breed = theBreed; } public String toString() { return "Superclass: " + breed; } protected String breed; } public class Cow { public Cow(String theBreed) { super(theBreed); } public String toString() { return "Subclass: " + breed; } public static void main(String[] args) { Cow c = new Cow("cow"); System.out.println(c); } }
Subclass: cow
Superclass: cow
Select the most appropriate answer.