Difference between interface and abstract class

213 views · Published 6 February 2014 · 2:18 · Indexed 6 November 2026

Channel: Interview DOT · 2014 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. Difference between interface and abstract class

What is the difference between interface and abstract class ? Java Interview Question And Answer ?

What is the difference between interface and abstract class ?

        Interface contains methods that must be abstract; abstract class may contain concrete methods.

        Interface contains variables that must be static and final; abstract class may contain non-final and final variables.

        Members in an interface are public by default, abstract class may contain non-public members.

        Interface is used to "implements"; whereas abstract class is used to "extends".

        Interface can be used to achieve multiple inheritance; abstract class can be used as a single inheritance.

        Interface can "extends" another interface, abstract class can "extends" another class and "implements" multiple interfaces.

        Interface is absolutely abstract; abstract class can be invoked if a main() exists.

        Interface is more flexible than abstract class because one class can only "extends" one super class, but "implements" multiple interfaces.

        If given a choice, use interface instead of abstract class. 
A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm

Are you looking for a new Job ?
InterviewDot.com - A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm



Difference between interface and abstract class

More from this channel