Solved

Suppose Animal Is an Interface That Specifies a Single Method

Question 14

Multiple Choice

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.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents