What is the difference between Abstract and Interface?

Answer Posted / anand

Abstract Class:

1. Abstract Class Can contain Abstract Methods and Non-
Abstract Methods.

2. When a Non-Abstract Class is Inherited from an Abstract
Class, the Non-Abstract Class should provide all the
implementations for the inherited Abstract Method.

Interface:

1. Interface is nothing but Pure Abstract Class ie
Interface can contain only the function declaration.

2. All the members of the interface are Public by Default
and you cannot provide any access modifiers.

3. When a class is inherited from the interface, the
inherited class should provide actual implementations for
the inherited members.

Is This Answer Correct ?    80 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can non-default constructors be used with single call sao?

694


Is null in c#?

633


How to rotate an Image in C#?

757


Why is it important to override gethashcode when equals method is overridden?

726


I have 3 overloaded constructors in my class. In order to avoid making instance of the class do I need to make all constructors to private?

726






what is the syntax to inherit from a class in c#?

706


Is lazy thread safe c#?

640


What is the difference between gettype and typeof in c#?

622


Explain About Iunknown interface Queue

701


What is the advantage of generics in c#?

665


What is icollection in c#?

680


What is hashset c#?

662


What is data binding c#?

699


What is public or shared assemblies ?

741


Enlist some of the properties of a thread class?

679