Difference between abstract class and interface
Answer Posted / sreekanth madamanchi
1. Abstract classes can have implementations for some of
its members (Methods), but the interface can't have
implementation for any of its members.
2. Only an interface can extend another interface, but any
Class can extend an abstract class..
3. Class can inherit only one abstract class, but class can
implement more than one interface
4. An abstract class can contain constructors, but
interface can’t contain any constructors
5. An abstract class can’t support multiple inheritances,
but an interface can support multiple inheritances.
EX:- class A extends AbstractClass
Class A implements interface1, interface2
6. We can use various access modifiers to variables. such
as abstract, protected, internal, public in Abstract Class,
but all of the variables in an interface are implicitly
(Default) static and final.
7. An abstract class can contain abstract and non-abstract
methods, but interface contains only abstract methods. If
we declare the method without having abstract, by default
it takes that method as abstract method
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What size is a .net object?
what are the fundamental and common properties of .net controls?
What does the term "green architecture" mean? : Dot net architecture
What is cache coherency? : Dot net architecture
Explain about microsoft visual studio?
Difference between throw exception and rethrowing ?
Explain the difference between l1 and l2 cache? : Dot net architecture
What actually happes when you add a something to arraylistcollection ?
Explain what does the term "green architecture" mean? : Dot net architecture
What is Object Caching in Visual Studio 2010?
Explain how does .net mobile work? : Microsoft dot net mobile
What is Opf3
Explain pipelining? : Dot net architecture
Explain the race around condition? : Dot net architecture
what is the difference between master page and content page?