Solved

Consider the Following Code Snippet

Question 96

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

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