Okay, I'm having some headaches regarding the Friend and Protected Friend qualifiers. The information I read everywhere looks like legal language to me. Some like simpler legal language, but still legal language.
So, I'll try to provide a framework of thought in pseudo-VB:
Suppose I have AssemblyOne:
Public Class classA_One
Public memberPub
Private memberPriv
Protected memberProt
Friend memberFri
ProtectedFriend memberProFri
End Class
Public Class classAB_One
Inherits classA_One
...
End Class
Public Class classC_One
Dim objA_One as classA_One
End Class
Someone else (a colleage) takes my generated .dll, references it, and creates AssemblyTwo:
Public Class ClassAD_Two
Inherits classA_One
...
End Class
Public Class classE_Two
Dim objA_One as classA_One
End Class
What I want to know is the visibility of the members of classA_One. I am sure that:
memberPub is visible everywherememberPriv can be seen only within classA_OnememberProt can be seen in classA_One, classAB_One, and classAD_OneWhat I'm not sure is the visibility of the other two members of classA_One.
Can someone help me?
TIA.
Friend: means that it is accessible to any type inside your assembly no one referencing you assembly will be able to see it.
Protected Friend: means that the type is only accessible by derived members or your assembly types not derived or not part of your assembly will not be able to access it.
memberFri: is accessible to classAB_one and all other in assembly classes
memberProFri: is accessible to classAB_one but not in classC_one
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With