Click here to Skip to main content
15,896,727 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i want what is default access specifier for hole entire .net application
Posted
Comments
[no name] 9-Apr-12 14:34pm    
And I want people to learn to search for the answers to stupidly simple questions.

Who will get their wish first?
musale pradeep rao 9-Apr-12 14:44pm    
did u know tell me other wise leave it
Sergey Alexandrovich Kryukov 9-Apr-12 14:52pm    
Why do you think he must leave it? In case you did not notice, he have you a practical advice already -- all you need it to follow it.
Did not get it yet? Read some documentation. And don't be so rude. You comment simply says: "shut up". And this is pretty rude.
--SA
musale pradeep rao 9-Apr-12 15:00pm    
i am fresher in .net developer so that's way asking to this type of question,this question is ask to interviewer
Sergey Alexandrovich Kryukov 9-Apr-12 15:04pm    
...to interviewer?.. :-)
--SA

There is no one specifier for all objects within an application.
For classes and structs immediately within a namespace (i.e. at the top level) the default access specifier is internal
For classes and structs, properties, fields, enums and methods within a class it is private

However, it is a very, very good idea to absolutely state the access specifier at all times - that way you cannot make a mistake, and it forces you to think about what kind of access is appropriate for it.

See MDSN[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900