Restrict Access of Class

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have 2 Class i.e ClassA and ClassB, I want ClassB to be Accessed only by
ClassA ONLY and nowhere in this project nor in other projects. How can I
achieve this ?

Regards,
Mustaq
 
Mustaq said:
I have 2 Class i.e ClassA and ClassB, I want ClassB to be Accessed only by
ClassA ONLY and nowhere in this project nor in other projects. How can I
achieve this ?

Make ClassB a private nested class within ClassA.
 
Hi Jon Skeet,

Thanks for your message, can you give me example in VB.NET

Thanks
& Regards,
Mustaq
 
Mustaq,

This is the newsgroup "General" about dotnet.

For language questions there are other newsgroups by instance.

microsoft.public.dotnet.languages.vb

In general Jon wrote
Public class a
friend class b
end class
end class

I hope this helps,

Cor
 

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