Solved

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

Posted on 2006-11-06
8
2,137 Views
Last Modified: 2010-07-27
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
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 15

Expert Comment

by:ozymandias
ID: 17885232
A class is private...not sure about those members...probably private too.
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 17885295
A class is internal by default, and its members are private by default.
0
 
LVL 15

Accepted Solution

by:
ozymandias earned 250 total points
ID: 17885320
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 15

Expert Comment

by:ozymandias
ID: 17885351
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
 

Author Comment

by:mathieu_cupryk
ID: 17885372
what is the closest answer.
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 17887260
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
 
LVL 15

Expert Comment

by:ozymandias
ID: 17887494
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
 
LVL 16

Expert Comment

by:muzzy2003
ID: 17887529
Well, if it's a question of choosing between the four statements, then they're all false.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question