Hi, my name is Alex. I'm fairly new to C# but apparently I may be required to know how to manipulate .NET Frameworks via C# so I am studying a beginners book and another book to thoroughly understand the language.

The problem is that I am struggling to understand the concept of the internal command.

As quoted from the 2nd book I'm reading--

"...On the other hand, if a class is internal, the semantics of access modifies is identical to those of a public class except for one key restriction: Acces is limited to those classes within the same compiled unit. Otherwise, no method or data field of an internal class is directly accessible among classes that are compiled separately."

It seems straightforward, but now I'm curious as to how a class is considered to be in our outside of a compiled unit?

For example, if I include ('using') a class to be used within the current C# program, is that class now included in the compiled unit also, and therefore I have access to its internal methods? Or is the compiled unit strictly the classes within the initial namespace (or in a namespace)?

Also, if C# is like C++ where you can use other namespaces in a given namespace, will the namespace that is included be a part of the compiled unit?

Any explanation to clear up this mist would be nice. Thank you!


9 Years
Discussion Span
Last Post by Alex Edwards
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.