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
 
Back
Top