• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2146
  • Last Modified:

What is the default accessibility level of a class and the class members?

A class is public and class members are public by default.
 
 
--------------------------------------------------------------------------------
 
  A class is public and class members are private by default.
 
 
--------------------------------------------------------------------------------
 
  A class is private and class members are public by default.
 
 
--------------------------------------------------------------------------------
 
  A class is private and class members are private by default.
 
0
mathieu_cupryk
Asked:
mathieu_cupryk
  • 4
  • 3
1 Solution
 
ozymandiasCommented:
A class is private...not sure about those members...probably private too.
0
 
muzzy2003Commented:
A class is internal by default, and its members are private by default.
0
 
ozymandiasCommented:
Unless thay have changed the rules recently the default accessibility level of a class is private.

http://msdn2.microsoft.com/en-us/library/ba0a1yw2(VS.80).aspx
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ozymandiasCommented:
I take it back...

http://msdn2.microsoft.com/en-us/library/ms173121(VS.80).aspx

Classes are internal and their members are private...however that was not one of the options offered :)
0
 
mathieu_cuprykAuthor Commented:
what is the closest answer.
0
 
muzzy2003Commented:
Sorry, guys, but the article that ozymandias posted clearly says:

"Classes and structs are declared as internal by default"

It is the class's members that are private by default. Not bothered about the points, just don't want you getting the wrong answer.
0
 
ozymandiasCommented:
It's a tricky one.

An internal class is public to classes in the same assembly but private to ones outside that assembly.
Does this means it more public than private or more private than public ?
0
 
muzzy2003Commented:
Well, if it's a question of choosing between the four statements, then they're all false.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now