Hi friends,
I want to know How to implement access modifiers Protected, Internal and Protected Internal ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted May 17, 2012, 7:19 AM
C# supports five types of access modifier. It sets previllage to the members, properties and methods in a class or struct or interface or abstract class.
private - can be accessed with in the class
public - can be accessed any where
protected - can be accessed with in the class and inherited class
internal - can be accessed with in the current assembly
protected internal - can be accessed with the current assembly and class inherits in the outside assembly.
public class Sample
{
private void number(int num)
{
this.num = num;
}
public int add(int a, int b)
{
return (a+b);
}
}
Hope this will help you.
VulpesPosted May 16, 2012, 12:16 PM