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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top