✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
class Toy {
public void printName() {
System.out.println("Toy");
}
}
class Doll extends Toy {
public String printName() {
System.out.println("Doll");
return "Doll";
}
}
public class TestToys {
public static void main(String[] args) {
Toy doll = new Doll();
doll.printName();
}
}
Який результат?