Suppose Animal is an interface that specifies a single method - speak. Now suppose the Dog class implements the Animal interface. In addition to the speak method, the Dog class also has a method called wagTail. Now consider the following code.
Animal a = new Dog ();
a. wagTail ();
Which of the following is true about this code?
a) It will result in a compile-time error.
b) It will result in a run-time error.
c) It will call the speak method defined in the Animal interface.
d) It will call the wagTail method defined in the Dog class.
e) none of the above are true.
+5
Answers (1)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Suppose Animal is an interface that specifies a single method - speak. Now suppose the Dog class implements the Animal interface. In ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Home » Computers & Technology » Suppose Animal is an interface that specifies a single method - speak. Now suppose the Dog class implements the Animal interface. In addition to the speak method, the Dog class also has a method called wagTail. Now consider the following code.