idea]
Protected --> Accessible ONLY by 1.Derived classes 2.Within
the same class
Or
1. Code within the class
2. Code in derived classes within the same assemblies
3. Code in derived classes in other assemblies
A Protected procedure may only be declared within a class.
Procedures declared within the same class can call it, as
can other methods in inherited classes.[From MSDN]
methods in inherited classes.
Protected variables can be used within the class as well as
the classes that inherites this class.
Friend --> Accessible ONLY by 1.Derived classes 2.Classes
in the same assembly 3.Within the same class
Or
1. Code within the class
2. Code in derived classes within the same assembly
3. Other code in the same assembly
Friends can be accessed by all classes within assembely but
not from outside the assembely.
A variable declared with the Friend access specifier can only
be seen by other classes within the same program. This means
that if a class has a Friend variable and that class resides
in a DLL, then only other classes within the same DLL can see
that Friend variable. Any other program that uses that DLL
cannot see that variable.[From MSDN]
Protected Friend --> Accessible ONLY by 1.Derived classes
2.Classes in the same assembly 3.Within the same class
Or
1. Code within the class
2. Code in derived classes within the same assembly
3. Other code in the same assembly
4. Code in derived classes in other assemblies
The Protected Friend can be accessed by Members of the
Assembely (Friend) or the inheriting Assembely class
(Protected).
No comments:
Post a Comment