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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:56:59+00:00 2026-05-29T10:56:59+00:00

I have two options in VS2010 for implementing interfaces. When I have IHelper.cs interface

  • 0

I have two options in VS2010 for implementing interfaces.

enter image description here

When I have IHelper.cs interface as follows:

public interface IHelper
    ....
    IEnumerable<IPort> Ports { get; }

“Implement Interface Explicitly” gives this code:

    IEnumerable<IPort> IHelper.Ports
    {
        get
        {
            ...
        }
    }

And, “Implement Interface” gives me this code:

    public IEnumerable<IPort> Ports
    {
        get
        {
            ...
        }
    }

Are they the same or different? Why do I have two options in implementing interfaces in C#?

  • 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-29T10:57:00+00:00Added an answer on May 29, 2026 at 10:57 am

    Explicit interface declarations mean that the interface members are not available on types other than the interface itself, so implementing types would need to be cast to the interface before accessing them publicly.

    Implicit, the standard way in which most interfaces are implemented, exposes interface items on the implementor-type’s public API.

    The main reason for explicit interface definitions is to avoid naming conflicts if you happen to implement two interfaces that contain methods with the same signature… the explicit definition allows the compiler to keep the signatures distinct enough to resolve.

    A secondary reason that supports code maintenance, as suggested by XenoPuTtSs in the comments, is that explicit definitions will trigger compiler errors on the implementing types if the method signature is removed. On implicit implementations, removing a method from the interface will leave the method as a regular member of any types – meaning you need to search manually for now-defunct method implementations.

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

Sidebar

Related Questions

I am implementing slideshow. I have two options for paging between images: 1) to
In my models, I have two options...when I get to a variable that necessitates
I have two options: public class SyntaxException extends RuntimeException { private String msg; public
I want to parse a large XML file and I have two options: Perl
Hy, I have two options to choose from: Client side(with FLASH or Javascript): pro:
I have a ADO.NET/TSQL performance question. We have two options in our application: 1)
I need to write data into drive. I have two options: write raw sectors.(_write(handle,
I have two models like this: class OptionsAndFeatures(models.Model): options = models.TextField(blank=True, null=True) entertainment =
At the moment I have two tables, products and options . Products contains id
i have two options One <%= Html.CheckBox(postType, false, new { @id = item.int_PostTypeId.ToString() })%>

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.