internal and internal protected
-
Internal-Access is limited to the current assembly. Internal Protected-Access is limited to the current assembly or types derived from the containing class. after then i implemented it , for that i created window application project and a class library project. in class library project namespace i did the following code namespace ClassLibrary1 { public class Class1 { protected int aniket = 10; protected internal int tushar = 20; internal int pavan = 30; } } and in the window application project , after adding the reference of class library project , in the class file , i did the following code. namespace validation1 { class Class2: Class1 { void method() { //variable aniket and tushar are accessible in thederived class due to reason that they are protected inernal and protected respectively. //while the member named pawan is not assessible, because it's datatype is intenal. Is this all the difference between internal and internal protected. I mean , i wanted to ask that the findings i did for these two access modifiers are correct , or there is somethig else , that is needed to be understood the difference between them. } } }
Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....
-
Internal-Access is limited to the current assembly. Internal Protected-Access is limited to the current assembly or types derived from the containing class. after then i implemented it , for that i created window application project and a class library project. in class library project namespace i did the following code namespace ClassLibrary1 { public class Class1 { protected int aniket = 10; protected internal int tushar = 20; internal int pavan = 30; } } and in the window application project , after adding the reference of class library project , in the class file , i did the following code. namespace validation1 { class Class2: Class1 { void method() { //variable aniket and tushar are accessible in thederived class due to reason that they are protected inernal and protected respectively. //while the member named pawan is not assessible, because it's datatype is intenal. Is this all the difference between internal and internal protected. I mean , i wanted to ask that the findings i did for these two access modifiers are correct , or there is somethig else , that is needed to be understood the difference between them. } } }
Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....
You got something wrong. Public = Accessible from everywhere Protected = Accessible from class or derived classes. Private = Accessible only from the same class (if you don't specify anything, by default it will be Private) internal = Access is only for the same assembly. internal means that if I\anyone-else download your class library file (dll) and try to use it, I won't be able to use the stuff that signed with "internal". So what that you basically did was playing with the "Private" modifier. Hope you get what I wrote (I can be not-understandable in the morning). NaNg.
-
Internal-Access is limited to the current assembly. Internal Protected-Access is limited to the current assembly or types derived from the containing class. after then i implemented it , for that i created window application project and a class library project. in class library project namespace i did the following code namespace ClassLibrary1 { public class Class1 { protected int aniket = 10; protected internal int tushar = 20; internal int pavan = 30; } } and in the window application project , after adding the reference of class library project , in the class file , i did the following code. namespace validation1 { class Class2: Class1 { void method() { //variable aniket and tushar are accessible in thederived class due to reason that they are protected inernal and protected respectively. //while the member named pawan is not assessible, because it's datatype is intenal. Is this all the difference between internal and internal protected. I mean , i wanted to ask that the findings i did for these two access modifiers are correct , or there is somethig else , that is needed to be understood the difference between them. } } }
Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....
Sonia Gupta wrote:
Is this all the difference between internal and internal protected.
Yes. Protected - visible to all subclasses Internal - visible everywhere within the assembly Protected internal - visible to all subclasses *and* everywhere within the assembly.
Cheers, Vıkram.
Be yourself, no matter what they say. - Sting, Englishman in New York.
-
You got something wrong. Public = Accessible from everywhere Protected = Accessible from class or derived classes. Private = Accessible only from the same class (if you don't specify anything, by default it will be Private) internal = Access is only for the same assembly. internal means that if I\anyone-else download your class library file (dll) and try to use it, I won't be able to use the stuff that signed with "internal". So what that you basically did was playing with the "Private" modifier. Hope you get what I wrote (I can be not-understandable in the morning). NaNg.
code is right or wrong?
Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....
-
Sonia Gupta wrote:
Is this all the difference between internal and internal protected.
Yes. Protected - visible to all subclasses Internal - visible everywhere within the assembly Protected internal - visible to all subclasses *and* everywhere within the assembly.
Cheers, Vıkram.
Be yourself, no matter what they say. - Sting, Englishman in New York.
http://www.codeproject.com/script/comments/forums.asp?msg=2201926&forumid=1649#xx2201926xx[^]
Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....
-
code is right or wrong?
Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....