PRO192_-_QUIZ2_-_SL4_3930.webp
Hữu Vinh

PRO192_-_QUIZ2_-_SL4_3930.webp

Question 15
Not yet
answered
Flag.
question
Given the following classes, what will be the output of the main method?
class Animal {
void makeSound() {
System.out.println("Animal makes sound");
}
}
class Dog extends Animal {
void makeSound() {
System.out.println("Dog barks");
}
}
public class Main {
public static void main(String[] args) {
}
Animal myDog = new Dog();
myDog.makeSound();
}
O a. Animal makes sound
O b. Compilation error
Oc. Dog barks
O d. Runtime error

Thông tin

Category
PRO192
Thêm bởi
Hữu Vinh
Ngày thêm
Lượt xem
322
Lượt bình luận
2
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom