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 5947993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:02:37+00:00 2026-05-22T17:02:37+00:00

I use interfaces for decoupling my code. I am curious, is the usage of

  • 0

I use interfaces for decoupling my code. I am curious, is the usage of explicit interface implementation meant for hiding functionality?

Example:

public class MyClass : IInterface
{
     void IInterface.NoneWillCall(int ragh) { }
}

What is the benefit and specific use case of making this available only explicitly via the interface?

  • 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-22T17:02:38+00:00Added an answer on May 22, 2026 at 5:02 pm

    There are two main uses for it in my experience:

    • It allows you to overload methods by return value. For example, IEnumerable<T> and IEnumerable both declare GetEnumerator() methods, but with different return types – so to implement both, you have to implement at least one of them explicitly. Of course in this question both methods are provided by interfaces, but sometimes you just want to give a “normal” method with a different type (usually a more specific one) to the one from the interface method.
    • It allows you to implement part of an interface in a “discouraging” way – for example, ReadOnlyCollection<T> implements IList<T>, but “discourages” the mutating calls using explicit interface implementation. This will discourage callers who know about an object by its concrete type from calling inappropriate methods. This smells somewhat of interfaces being too broad, or inappropriately implemented – why would you implement an interface if you couldn’t fulfil all its contracts? – but in a pragmatic sense, it can be useful.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A good example of when exactly to use interfaces specifically in Java would be
I made the following code example to learn how to use a generics method
I would like to use interfaces in c++ like in java or in c#.
Does it make sense to use interfaces for your domain object factories by default,
I'm refactoring a number of classes in an application to use interfaces instead of
I read all over the place about how Spring encourages you to use interfaces
Hi are there any nice videos or other resources on how to use Interfaces
In C#, when should you use interfaces and when should you use abstract classes?
I'm trying to show someone a use for interfaces in a crazy situation they've
In considering languages to use in creating a web-application that interfaces with a database

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.