lass Animal {
void makeSound() {
System.out.print(“Animal sound”);
}}
class Dog extends Animal {
@Override
void makeSound() {
super.makeSound();
System.out.print(“Woof”);
}}
public class Test {
public static void main(String[] args) {
Animal animal = new Dog();
animal.makeSound();
}}
问题: 程序的输出结果是什么?
点点赞赏,手留余香
给TA打赏




评论0