Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

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.
 
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

A class is private...not sure about those members...probably private too.
Avatar of muzzy2003
muzzy2003

A class is internal by default, and its members are private by default.
ASKER CERTIFIED SOLUTION
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 :)
Avatar of mathieu_cupryk

ASKER

what is the closest answer.
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.
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 ?
Well, if it's a question of choosing between the four statements, then they're all false.