What is the output of the following Java program?
class Animal { void sound() { System.out.print("generic "); } }
class Dog extends Animal { void sound() { System.out.print("bark "); } }
public class Main {
public static void main(String[] args) {
Animal x = new Dog();
x.sound();
Animal y = new Animal();
y.sound();
}
}