What is the valid declarations within an interface definition? - ProProfs Discuss
Advertisement

What is the valid declarations within an interface definition?

Asked by AnandVR, Last updated: Apr 05, 2024

+ Answer
Request
Question menu
Vote up Vote down

1 Answer

AnandVR

AnandVR

AnandVR
AnandVR

Answered Aug 14, 2019

Public double methoda();

Option A is correct. A public access modifier is acceptable. The method prototypes in an interface are all abstract by virtue of their declaration, and should not be declared abstract. Option B is wrong. The final modifier means that this method cannot be constructed in a subclass. A final method cannot be abstract. Option C is wrong. static is concerned with the class and not an instance.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.