c# access modifiers , csharp access specifiers
TRANSCRIPT
-
3/18/2015 C#AccessModifiers,CSharpAccessSpecifiers
http://csharp.netinformations.com/language/csharpaccessspecifiers.htm 1/2
Netinformations.com
C#AccessModifiers,C#AccessSpecifiersAccess Modifiers (Access Specifiers) describes as the scope ofaccessibility of an Object and its members. All C# types and typemembershaveanaccessibilitylevel.Wecancontrolthescopeofthememberobjectofaclassusingaccessspecifiers.Weareusingaccessmodifiers for providing security of our applications.Whenwe specifytheaccessibility of a typeormemberwehave todeclare it byusinganyoftheaccessmodifiersprovidedbyCSharplanguage.
C#providefiveaccessspecifiers,theyareasfollows:
public,private,protected,internalandprotectedinternal.
public:
public is themost commonaccess specifier inC# . It can be accessfromanywhere,thatmeansthereisnorestrictiononaccessibility.Thescopeoftheaccessibilityisinsideclassaswellasoutside.Thetypeormembercanbeaccessedbyanyothercode inthesameassemblyoranotherassemblythatreferencesit.
private:
Thescopeoftheaccessibilityislimitedonlyinsidetheclassesorstructinwhich theyaredeclared.Theprivatememberscannotbeaccessedoutsidetheclassanditistheleastpermissiveaccesslevel.
protected:
Thescopeofaccessibility is limitedwithin theclassorstructand theclassderived(Inherited)fromthisclass.
internal:
The internal access modifiers can access within the program thatcontainitsdeclarationsandalsoaccesswithinthesameassemblylevelbutnotfromanotherassembly.
protectedinternal:
Protected internal is the same access levels of both protected andinternal.Itcanaccessanywhereinthesameassemblyandinthesameclassalsotheclassesinheritedfromthesameclass.
Next:HowtoCultureInfoinC#
CSharpLanguageBasicsRelatedContents
C#Types
C#boxingandunboxing
Share
AnoverviewofMicrosoftC#
C#LanguageTutorial
C#StatementsTutorial
C#GraphicalUserInterfaceTutorial
C#CollectionTutorial
C#StringTutorial
C#FileOperationsTutorial
C#ExcelTutorial
C#CrystalReportsTutorial
CSharpCommunicationTutorial
C#Ado.NetTutorialandSourceCode,c#databaseprogrammingtutorial
C#ADO.NETdataProvidersTutorial
C#DatasetTutorial
SiteMap|About
Home C# VB.NET ASP.NET AJAX .NetFramework InterviewQuestions About
-
3/18/2015 C#AccessModifiers,CSharpAccessSpecifiers
http://csharp.netinformations.com/language/csharpaccessspecifiers.htm 2/2
C#DataTypes
C#typeconversions
HowtoCultureInfoinC#
CSharpLanguageBasicsRelatedPrograms
C#OperatingSystemInformation
StartandKillProcessesinC#
RandomNumberGeneratorinC#
C#DataAdapaterTutorial
CsharpDataViewTutorial
CsharpRemotingTutorial
C#XMLTutorial
C#DataGridViewTutorial
MoreSourceCode: Search Mailto:[email protected]
netinformations.com(C)2015FoundedbyrapsmkAllRightsReserved.Allothertrademarksarepropertyoftheirrespectiveowners.
DSL - Sample PreparationUK supplier of Herzog sample prep equipment for xrf,xrd,oes analysis