Resources » .NET programming » .NET Framework

Control on visibility in C#


Posted Date: 16-Mar-2012  Last Updated:   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.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    anitha
    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India