what modifiers are allowed for methods in an interface java interview question and answer

572 views · Published 27 November 2012 · 2:08 · Indexed 23 October 2026

Channel: Interview DOT · 2012 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. You can submit your resume for right Job

http://www.interviewdot.com/upload-resume/uploadresume.htm
http://www.interviewdot.com http://www.interviewdot.com http://www.interviewdot.com

Welcome to www.InterviewDot.com
What is the reason ,an Interface be able to extend more than one Interface but a Class can't extend more than one Class ? Java Interview Question and Answer :


What is the reason ,an Interface be able to extend more than one Interface but a Class can't extend more than one Class ?

Basically Java doesn't allow multiple inheritance, so a Class is restricted to extend only one Class. But an Interface is a pure abstraction model and doesn't have inheritance hierarchy like classes. 
So an Interface is allowed to extend more than one Interface.


 Can I mark the Interface as "final "?

No ,an interface cannot be marked as "final" ,Doing so will result in compilation error.

"illegal modifier for the interface finalInterface; only public & abstract are permitted."

You can submit your resume for right Job

http://www.interviewdot.com/upload-resume/uploadresume.htm
http://www.interviewdot.com http://www.interviewdot.com http://www.interviewdot.com

More from this channel