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

Show us in simple steps to create setup & deployment project for windows application?

498


Give an example of a directcast.

518


How to use reflection to call generic method?

502


What are the types of assembly available

513


Explain about finalize method?

548






Why are dynamic link library used over static one?

546


what happens if you inherit multiple interfaces and they have conflicting method names?

492


Is string immutable in c#?

574


What is a must for multitasking

569


Why is it efficient to use System.string under System.Text.StringBuilder ?

525


What does args mean in c#?

494


List the fundamental oop concepts?

523


Explain the types of Polymorphism.

581


Explain partial class in c#?

497


How does array sort work?

500