Solved

Consider the Following Code Snippet

Question 43

Multiple Choice

Consider the following code snippet:
Public class Inventory implements Measurable
{
Private int onHandCount;
) . .
Double getMeasure() ;
{
Return onHandCount;
}
}
Assume that getMeasure() is a method in the interface Measurable. 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

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

Related Questions