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

what are nullable types in c#

522


How do I enforce const correctness in c#?

532


What is public, private, protected, internal and internal protected?

529


what is main function of alternate teamplate of datalist?

1642


Is php easier than c#?

492






What is the process of Serialization?

560


How do I run a cshtml file?

497


Which is faster array or arraylist in c#?

479


What is difference between static and constant variable?

529


Explain nullable types in c#?

541


What is the and operator in c#?

485


What is difference between dictionary and hashtable?

519


What's the difference between the debug class and trace class? Documentation looks the same.

505


What is decimal in c#?

503


Explain the access modifiers in c#?

493