Solved

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

Posted on 2006-11-06
8
2,131 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What .NET website keeps me current? 9 56
Achieve json result 2 65
Replace &lt; with < 14 55
Filename to be appended with DateTimeof Download 3 44
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now