Difference between abstract class and interface
Answer Posted / deepak jindal
ABSTRACT CLASS:
1) we can't create object of abstract class.
2) we can declare a variable.
3) we can make normal method and abstract method.
4) we can't make method body with abstract method.
5) in derived class we can use abstract method by override
keyword.
6) we can't use multiple inheritance in abstract class.
7) Absrtact class can be extended by only one class;
Interface can be implemented by more than one class;
ie. class can inherit only one abstract class
8)Abstract classes can inherit interfaces while interfaces
cannot inherit abstract classes
but class can implement more than one interface.
9) The members of the interface are public with no
implementation. Abstract classes can have protected
parts,static methods, etc.
10)An abstract class can contain fields,
constructors, or destructors and implement properties. An
interface can not contain fields, constructors, or
destructors and it has abstractmethod,property's signature
but no implementation etc.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain what does the term "green architecture" mean? : .NET Architecture
Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure on hardware that converts the ascii value to binary? : .NET Architecture
what are the events for a form?
Do you know textbox and textview controls of .net mobile? : Microsoft dot net mobile
What are the options provived by vss to the user? how it will help us while delevoping application?
Can I create my own context attributes?
What is the difference between absolute expiration and sliding-time expiration?
Explain about the base class library provided by microsoft.net?
What is an asssembly qualified name? Is it a filename? How is it different?
Explain the five stages in a dlx pipeline? : Dot net architecture
What is .net mobile utility controls. Explain with an example? : Microsoft dot net mobile
Explain how does .net mobile work? : Microsoft dot net mobile
Explain about cookie less session state? : .NET Architecture
12. Types of polymorphisem[Run and Design Exp.]
What is the difference between primary & secondary storage device? : Dot net architecture