Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

AP CSA Question of the Day March 4, 2025

Reference
  1. Incorrect Correct No Answer was selected Invalid Answer

    Given:

    Animal.java

    public class Animal {
        String name;
    
        public Animal(String name) {
            this.name = name;
        }
    
        public void speak() {/* Implementation not shown */}   
    }
    Java

    Dog.java

    public class Dog extends Animal {
        String breed;
    
        public Dog(String name, String breed) {
            this.breed = breed;
    
            super(name);
        }
    
        public void speak() {/* Implementation not shown */}
    }
    Java

    Main.java

    public class Main
    {
        public static void main(String[] args)
        {
            Dog dog = new Dog("xochi", "chihuahua");
            dog.speak();
        }
    }
    Java

    What will this program do?