Q:

What is the difference between Interface and Abstract class?

0

What is the difference between Interface and Abstract class?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

# Abstract class Interface Class
1. Abstract class can have implementation for some of its members or methods. Interface class can not have implementation for any its members.
2. Abstract class can have fields. Interface class can not have fields.
3. Abstract class can inherit from another Abstract class or another interface. Interface class can inherit from another interface class only. Interface cannot inherit from an abstract class.
4. Abstract class members can have access modifiers. Interface class members can not have access modifiers.
5. Abstract class doesn’t support multiple inheritance. Interface supports multiple inheritance.
e.g. Example:
public abstract class Shape{
public abstract void draw();
}
Example:
public interface Drawable{
void draw();
}.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Top 100 C# interview questions and answers 2022

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is the difference between static & dynamic po... >>
<< Explain Abstract class?...