954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

New to C#

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!

-Alex

Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 
The internal keyword is an access modifier for types and type members. Internal types or members are accessible only within files in the same assembly

if you are using other dll's you can't access theirinternal classes or properties.

http://msdn.microsoft.com/en-us/library/7c5ka91b(VS.80).aspx check this url for examples

tonakai
Junior Poster
121 posts since Feb 2005
Reputation Points: 25
Solved Threads: 11
 

if you are using other dll's you can't access their internal classes or properties.

http://msdn.microsoft.com/en-us/library/7c5ka91b(VS.80).aspx check this url for examples

It seems that I need to continue reading and get a thorough grasp on how assemblies are used in C# before I can really understand the difference.

Thanks!

Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You