Friend Class

  • Thread starter Thread starter Rahul Johri
  • Start date Start date
R

Rahul Johri

Hi,
Is there any difference between a "friend method" in "friend class" and a "public method" in "friend class"?

Rahul
 
Hi,
Is there any difference between a "friend method" in "friend
class" and a "public method" in "friend class"?


Yes, a Friend method can only be accessed in the same assembly whereas a
Public method can also be accessed from other projects/assemblies.
 
Rahul,
Is there any difference between a "friend method" in "friend class" and a "public method" in "friend class"?

Not really, either way the method will only be accessible to types in
the same assembly.



Mattias
 
Armin Zingler said:
Hi,
Is there any difference between a "friend method" in "friend
class" and a "public method" in "friend class"?


Yes, a Friend method can only be accessed in the same assembly
whereas a Public method can also be accessed from other
projects/assemblies.

Aahh sorry, Mattias is right. I didn't read carefully enough. Ignore my
reply.
 
Back
Top