Solved

Consider the Following Code Snippet: Public Class Inventory Implements Measurable

Question 2

Multiple Choice

Consider the following code snippet: public class Inventory implements Measurable
{
) . .
Double getMeasure() ;
{
Return onHandCount;
}
}
The compiler complains that the getMeasure method has a weaker access level than the Measurable interface. Why?


A) All of the methods in a class have a default access level of package access, while the methods of an interface have a default access level of private.
B) All of the methods in a class have a default access level of package access, while the methods of an interface have a default access level of public.
C) The variable onHandCount was not declared with public access.
D) The getMeasure method was declared as private in the Measurable interface.

Correct Answer:

verifed

Verified

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