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

Why delegates are type safe?

494


What is the system namespace?

484


What is different between Boxing and Unboxing?

595


What is difference between assembly and dll?

489


How many types of variables are there in c#?

532






How long can a string be c#?

516


What are the 2 broad classifications of fields in c#?

543


What is the purpose of abstract class in c#?

496


What is a reference type c#?

529


Is as operator in c#?

479


How is a string immutable?

498


What tool we have to use to install assembli in gac folder.

490


What are Indexers in C#?

595


What are the different types of classes in c#?

506


How to use session under class file of APP_Code folder?

524