What is the default access specifier in c#

  • Context: C# 
  • Thread starter Thread starter chandubaba
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 48K views
chandubaba
Messages
39
Reaction score
0
Hello,
what is the default access specifier in c#. In college everyone says its private, but in the textbook 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?
 
Physics news on Phys.org
Things declared outside of a class or struct will default to internal. Things declared inside of a class or struct will default to private.