what is the difference between interface and abstraction?

Answer Posted / navin c. pandit

In Interface, all the member functions are abstract implicitly
so it is imp. to define all fn. declared inside Interface.
Moreover, we cann't define a fn. or we cann't declare any
member variable in an Interface. Also, we cann't declare or
define any non-abstract method in Interface.

In Abstract class, we can declare an abstract method as well
as we can also define a non-abstract method. We can also
declare a variable member in abstract class.

In both the condition, declared abstract method is
implemented out side the class i.e in derived class which
inherits Interface/Abstract class, whatever you have used.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are mutable and immutable types in c#?

484


What does executescalar return in c#?

453


Name the two classes are required for implementing a windows service?

546


What are c# attributes and its significance?

517


What is entity framework c#?

455






What is the main purpose of linq?

477


What is a race condition?

487


What is managed or unmanaged code?

582


What are primitive data types in c#?

518


What is the use of the dispose method in C# ?

542


Can you store strings in arrays?

539


Are arrays immutable c#?

515


What's the implicit name of the parameter that gets passed into the set method/property of a class?

588


What is the use of flag in c#?

487


What are generations and how are they used by the garbage collector?

513