Solved

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

Posted on 2006-11-06
8
2,132 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
About delegates in c sharp 3 47
C# bracket error 3 30
Need to start a web service from Visual Studio 2015 Pro 2 21
C# winforms programmitically move panels 6 27
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 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

15 Experts available now in Live!

Get 1:1 Help Now