Friday 27 May 2016

access specifier

access specifier

List of access specifier:

Accessibility
Scope
Public
Member is accessible from other programs.
Protected
Member can be accessed by the containing and derived class.
Internal
Member can be accessed only the current program
Protected internal
Member can be accessed by the current program and the class derived from the containing class.

Example:

class ClassName 
{ 
public static string variableName; 

public void ClassMethod(string strName) 
{ 
variableName = strName; 
} 
}

you can also visit:  www.mybook-lang.com

No comments:

Post a Comment