Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What is the default access specifier in c#

  1. Jul 19, 2008 #1
    Hello,
    what is the default access specifier in c#. In college everyone says its private, but in the text book its written "When you do not specify any data member as public, protected or private the default access specifier for a class is internal."

    And in one forum I read that default access specifier for class is internal but for class members is private. But again in the same forum someone says everything is private. Which is correct?
     
  2. jcsd
  3. Jul 27, 2008 #2
    Things declared outside of a class or struct will default to internal. Things declared inside of a class or struct will default to private.
     
  4. Mar 31, 2009 #3
  5. Jan 29, 2010 #4
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Similar Discussions: What is the default access specifier in c#
  1. C: Format Specifier %f (Replies: 1)

Loading...