Access modifier based on namespace

  • Thread starter Thread starter JollyK
  • Start date Start date
J

JollyK

Hi all. I have a question.

Is it possible to have a class to have members which are only accessible by
other class members that belong to the same namespace?

JollyK.
 
JollyK said:
Hi all. I have a question.

Is it possible to have a class to have members which are only accessible by
other class members that belong to the same namespace?

JollyK.

I think the closest thing that you are going to find is 'internal' -- however
provides accessibility control at the assembly level.
 
No. Namespaces are a design time feature that don't have any affect on the final executable, therefore they don't affect scope.
 
No. Namespaces are a design time feature that don't have any affect on
the final executable, therefore they don't affect scope.

Sure they affect scope! A Type is always stored in the assembly with its
fully qualified type, that means:

[assemblyname]namespace.typename

if you have multiple classes named Fubar, it depends on the namespace which
class is used.
 
Charlie said:
No. Namespaces are a design time feature that don't have any
affect on the final executable, therefore they don't affect scope.

Um, they *do* have an effect on the final executable. The namespace of
a type is part of its full name.
 
Back
Top