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


Please Help Members By Posting Answers For Below Questions

What is an asssembly qualified name? Is it a filename? How is it different?

508


how to delete the record using data reader

1854


What is .net transaction?

479


Explain how cache is used? : Dot net architecture

585


Explain the difference between l1 and l2 cache? : .NET Architecture

549






I can't be bothered with cas. Can I turn it off?

528


Use of Enable view state ? if turn off what happen ?

3804


What are the major differences between services and web services?

493


What is an interrupt? : Dot net architecture

504


Can you Explain element .net mobile with example? : Microsoft dot net mobile

483


What are .net mobile controls features? : Microsoft dot net mobile

488


what is diffrent beatween localprinter and networkprinter

1360


What is biginteger and when would you use that?

531


How to improve the cache performance? : .NET Architecture

547


deference between display and visibility property of CSS

1785