Subscribe to Subscribers
Talk to Webmaster Tony John

Resources » .NET programming » .NET Framework

Control on visibility in C#


Posted Date:     Category: .NET Framework    
Author: Member Level: Gold    Points: 5


Visibility control in C# is technique that allows to control visibility of a class,variable or method.with use of visibility control , you can restrict access of a class,variable or method and define their scope in C# programs.



 


Visibility Control


Like as another programming language C# also provide Visibility control.you can control visibility of method,variable and class.Various access modifier available in C# that allows you to control visibility of method,class variables,are follows:
public: Specifies that the variables or method are accessible both inside and outside the class in which they are defined.

Protected: Specifies that the variables and method are accessible,within the class in which they are defined and they also accessible within driven class of that class.

strong>private:Specifies that the variables ant method can only be accessed within the class in which they are defined.

internal:Specifies that the variables and method are visible within the current compilation unit.
static: this is a modifier,which is used to control the visibility of a method only.The static access modifier specifies that method is not part of an instance of a class.
extern is a access modifier,which is used only for method.The extern access modifier specifies that the method can be called by other class defined in other C# program





Did you like this resource? Share it with your friends and show your love!


Responses to "Control on visibility in C#"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Increase your Stored Procedure Performance
    Previous Resource: Classes and Objects in C#
    Return to Resources
    Post New Resource
    Category: .NET Framework


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Scope of method  .  Scope of variables  .  
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.