Question
Answered
Which part of the following code will produce a compiler erro r if...
Which part of the following code will produce a compiler error if we know class cat extends a
class called animal and both of the classes have a method called makeNoise and class cat has a
method called showFood.
1 animal mydog = new animal();
2 cat mycat = new cat();
3 mydog.makeNoise();
4 mydog.showF
...[Show More]
Question
Answered
Which part of the following code will produce a compiler erro r if...
Which part of the following code will produce a compiler error if we know class cat extends a
class called animal and both of the classes have a method called makeNoise and class cat has a
method called showFood.
1 animal mydog = new animal();
2 cat mycat = new cat();
3 mydog.makeNoise();
4 mydog.showFood()
5 mycat.makeNoise();
6 mycat.showFood();
Group of answer choices
line 1, , mydog should be declared as type dog
line 2, cat should be declared as type animal
line 3, makeNoise() is not defined for mydog
line 4, showFood() is not defined for mydog
line 5, makeNoise() is not defined for mycat
line 6, showFood() is not defined for mycat
[Show Less]