Interviews3 answers
What’s the difference between an interface and abstract class?
3 Answers
An abstract class is a class that can not be instantiated but that can contain code.
An interface only contains method definitions but does not contain any code. With an interface, you need to implement all the methods defined in the interface.
Sonia KPosted Aug 13, 2012, 7:58 AM EDT
Abstract Class
1.It can contain Concrete methods(methods with implementation) So in other words, Abstract class can contain methods with both implemetaion
and without implementation
2.Multiple inheritance is not possible in case of abstract class
3.Access Specifiers are been Supported in abstract class
Interface
1.Does not contain any concrete methods
2.Multiple Inheritance is possible with interface
3.Access Specifiers are not supported in Interface
Sonia KPosted Aug 13, 2012, 7:57 AM EDT
chandrashekhar
Chandra ShekharPosted Jun 25, 2012, 1:34 AM EDT
