What is the difference between an Interface and abstract class?

What is the difference between an Interface and abstract class?

Senior Developer Asked on June 19, 2017 in JAVA.
Add Comment
1 Answer(s)

Interface :
{i}Interface can have only abstract methods.
{ii}Support multiple inheritance.
{iii}The “interface” keyword is used to declare interface.
{iv}Variables declared in a Java interface is by default final.

 

Abstract Class:
{i}Abstract class can have abstract and non-abstract methods.
{ii}Doesn’t support multiple inheritance.
{iii}The “abstract” keyword is used to declare abstract class.
{iv}An abstract class may contain non-final variables.

 

IT Head Answered on June 28, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.