What is the DIfference between Friend and Protected Friend?

Answer Posted / kuru

Protected --> Accessible ONLY by 1.Derived classes 2.Within
the same class

Friend --> Accessible ONLY by 1.Derived classes 2.Classes
in the same assembly 3.Within the same class

Protected Friend --> Accessible ONLY by 1.Derived classes
2.Classes in the same assembly 3.Within the same class


This is a very strange prob for which I've been looking for
an answer for a long time. As you can see above Friend and
Protected Friend are exactly same simply because 'Friend'
encompasses the accessibilities of both Protected and
Protected Friend. The question here is why did Microsoft
publish a 'Protected Friend' keyword when it is EXACTLY
same as Friend.

Is This Answer Correct ?    11 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is econo-jit?

622


What are the shadow variables?

597


What are the advantages of an assembly?

607


What is the difference between convert.tostring and i.tostring method?

561


What is the difference between readonly variable and constant variable?

569






Explain the difference between c# and vb.net?

559


What do you mean by Redim in VB.NET?

678


What is the diff between vb mdi form and .net mdi form?

552


What are the shared variables?

560


What is the difference between convert.tostring and .tostring() method?

532


Explain jit?

556


what is the advantage of option strict on?

612


What is portable executable?

586


Explain about garbage collection?

587


What is the difference between value and reference types?

549