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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:08:50+00:00 2026-05-14T03:08:50+00:00

Ok, so this may be a bit of a silly question, and there’s certainly

  • 0

Ok, so this may be a bit of a silly question, and there’s certainly the obvious answer, but I was curious if I’ve missed any subtleties here.

Is there any difference in terms of visibility/usability between a public member declared in an internal class and an internal member declared in an internal class?

i.e. between

internal class Foo
{
    public void Bar()
    {
    }
}

and

internal class Foo
{
    internal void Bar()
    {
    }
}

If you declared the method as public and also virtual, and then overrode it in a derived class that is public, the reason for using this modifier is clear. However, is this the only situation… am I missing something else?

  • 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-14T03:08:51+00:00Added an answer on May 14, 2026 at 3:08 am

    Consider this case:

    public interface IBar { void Bar(); }
    internal class C : IBar
    {
        public void Bar() { }
    }
    

    Here C.Bar cannot be marked as internal; doing so is an error because C.Bar can be accessed by a caller of D.GetBar():

    public class D
    {
        public static IBar GetBar() { return new C(); } 
    }
    

    A commenter asked a follow-up question: is an explicit implementation of an interface method considered to be public, or private? (C# does not allow you to put an access modifier on an explicit implementation.)

    Take a step back and think about what exactly is "public" or "private" about a member: people think wrong things like "private means that a method cannot be called from outside the class", but that’s not true; the class could make a delegate to a private method, pass it to anyone, and they can then call a private method.

    Rather, accessibility determines where the name of a thing can be used! Explicit interface implementations do not add a name to the class declaration space in the first place; they can only be referred to by name via the interface, not the class. It really doesn’t make sense to think of explicit interface implementations as public or private because they don’t have a name you can refer to.

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

Sidebar

Related Questions

This may be a silly question, but still I'm a bit curious... Recently I
This may be a bit of a weird question, but is there any reliable
I know this may sound silly little bit, but there is no other way
This may be a silly question but should I use the 32 bit or
This may be a easy question to answer but I am a bit stumped
This may be a bit silly question, but I just started doing pretty things
This may be a bit of daft question, but I don't come from an
This may sound like a bit of a rhetorical question, but I ask it
This question may seem a little bit stackoverflow-implementation specific, but I have seen a
I think this one is silly question, but it was a bit strange for

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.