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

  • Home
  • SEARCH
  • 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 7860197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:11:26+00:00 2026-06-02T22:11:26+00:00

I understand that an interface is an abstract type that contains no data, but

  • 0

I understand that an interface is an abstract type that contains no data, but exposes behaviours and properties, and that an instance of an object is an occurrence or a copy of an object that exists in memory.

I’m wondering about the differences in how the compiler / underlying code deals with the two? Based on the answer to this, why is the code more loosely coupled if I pass an interface as a dependency to an object rather than a concrete instance? What is the difference between what happens if I call the DoSomething method defined in an Interface to MyClass rather than the DoSomething method defined in the concrete instance of MyClass?

  • 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-06-02T22:11:27+00:00Added an answer on June 2, 2026 at 10:11 pm

    I know you said you understood what an interface is – but I do wonder if that’s entirely true given the way that you’ve linked your second question with the first. The second can be answered without any knowledge of the first, nor is it influenced in any way by it.

    Specifically on the question of why it’s more loosely coupled has nothing to do with the implementation of the compiler or anything: it’s just software architecture.

    Interfaces impose no restrictions on the implementing type other than the presence of the method/property (well, technically they’re methods too).

    The implementation doesn’t even have to be public on the type itself, nor does the type have to have a certain constructor etc. More importantly – it doesn’t even have to be a class. Then there’s the (rather edge-case) thing that with interfaces a single type can have multiple implementations of the same interface.

    As soon as you use a base class potentially introduce a whole load of other restrictions.

    True, these can clearly be a good thing too – for example if a known concrete base is known to be immutable (for consistency) and which doesn’t allow ‘nulls’ in it’s constructor etc (all not enforcable through an interface).

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

Sidebar

Related Questions

I understand that this may not necessarily apply to just @properties, but they would
I understand that neither a abstract class nor an interface can contain a method
I understand that it just saves the state of an object, but in what
I understand that I cannot add preconditions on an interface implementation. I have to
I understand that this a very noob problem, but when I try to create
I understand that there may be other questions regarding vanity urls but everyone i
I understand that you are not allowed to make cross domain Ajax calls, but
I've created an inherited field type annotation that is placed on private properties in
I understand that the http handlers process request but this is just theory as
First off, I understand the reasons why an interface or abstract class (in the

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.