Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 248059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:18:40+00:00 2026-05-11T21:18:40+00:00

Why do both the abstract class and interface exist in C# if we can

  • 0

Why do both the abstract class and interface exist in C# if we can achieve the interface feature by making all the members in the class as abstract.

Is it because:

  1. Interface exists to have multiple inheritance
  2. It makes sense to have interface because object’s CAN-DO feature should be placed in an interface rather base abstract class.

Please clarify

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:18:40+00:00Added an answer on May 11, 2026 at 9:18 pm

    Well, an abstract class can specify some implemetation, but usually not all of it. (Having said which, it’s perfectly possible to provide an abstract class with no abstract members, but plenty of virtual ones which with “no-op” implementations). An interface provides no implementation, merely a contract.

    You could certainly argue that if multiple inheritance of classes were permitted, interfaces would be largely pointless.

    Personally I don’t get hung up on the whole “is-a” vs “can-do” distinction for inheritance. It never gives me as good an intuition about what to do as just playing around with different ideas and seeing which ones feel the most flexible. (Then again, I’m very much a “favour composition over inheritance” guy…)

    EDIT: Just as the most convenient way of rebutting lbushkin’s third point in his comment… you can override an abstract method with a non-virtual one (in terms of not being able to override it further) by sealing it:

    public abstract class AbstractBase
    {
        public abstract void Foo();
    }
    
    public class Derived : AbstractBase
    {
        public sealed override void Foo() {}
    }
    

    Classes deriving from Derived cannot override Foo any further.

    I’m not in any way suggesting I want multiple inheritance of implementation – but if we did have it (along with its complexity) then an abstract class which just contained abstract methods would accomplish almost everything that an interface does. (There’s the matter of explicit interface implementation, but that’s all I can think of at the moment.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could simply put the ASP.NET user control inside the… May 11, 2026 at 11:34 pm
  • Editorial Team
    Editorial Team added an answer The 8 in 8.2 is the width "Minimum number of… May 11, 2026 at 11:34 pm
  • Editorial Team
    Editorial Team added an answer Content-type You don't need to specify that content-type on calls… May 11, 2026 at 11:34 pm

Related Questions

(Django 1.x, Python 2.6.x) I have models to the tune of: class Animal(models.Model): pass
I'm after a definitive reference to what ASP.NET code is required to disabled browsers
I didn't imagine that I would encounter radically new syntax in Java anymore at
I have two PHP functions to calculate the relation between two texts. They both

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.