internal?

Hi

Whats an internal method / field?

Also what is a protected internal?

Thanks
Paul
paulwhelanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gdupadhyayCommented:
Hi,
In C#, There r 5 access modifiers, These r
1. public
2. protected
3. private
4. internal and
5. protected internal.
Now,
1. public :   Visible to all.
2. protected : Visible only from derived classes.
3. private : Visible only within the given class.

4. internal : Visible only within the same assembly.
An internal item may only be accessed within the current assembly. An assembly in the .NET Framework equates roughly to Java's JAR file; it represents the building blocks from which other programs can be constructed

For Example :

public class BaseClass
{
       internal static int x = 0;   // Only accessible within the same assembly
}

5. protected internal : Visible only to the current assembly or types derived from the containing class i.e
access is limited to the current assembly or types derived from the containing class.

To know more abt. access modifier please follow this link
http://msdn2.microsoft.com/en-us/library/wxh6fsc7(VS.80).aspx

I hope from my comment u get the answer of ur question.

Thanks
Ganesh Dutt Upadhyay
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
paulwhelanAuthor Commented:
Sorry for the newbie question but what exactly is an 'assembly'?

Thanks!
Paul
0
paulwhelanAuthor Commented:
And what does "types derived from the containing class" mean?

Thanks
Paul
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

gdupadhyayCommented:
Hi,

Assembly: An assembly is a file that is automatically generated by the compiler upon successful compilation of every .NET application.It can be either a Dynamic Link Library or an executable file. It is generated only once for an application and upon each subsequent compilation the assembly gets updated. The entire process will run in the background of your application.
An Assembly contains Intermediate Language (IL) code, which is similar to Java byte code. In the .NET language, it consists of metadata. Metadata enumerates the features of every "type" inside the assembly or the binary. In addition to metadata, assemblies also have a special file called Manifest. It contains information about the current version of the assembly and other related information.

Now "types derived from the containing class" :
Suppose u have 2 assembly X and Y. u take a reference of X in Y. All the members which is declared in X as "protected internal" only visible in Y (if any class of X take as base class in Y).

I hope u got ur answer.

Thanks,
Ganesh Dutt Upadhyay

0
gdupadhyayCommented:
Hi,
Please read this link for more information

http://www.codeguru.com/columns/csharp_learning/article.php/c5845/


Thanks
Ganesh Dutt Upadhyay
0
paulwhelanAuthor Commented:
What does "u take a reference of X in Y" mean?
Thanks
0
gdupadhyayCommented:
X and Y are two separate assembly and i want to take a reference of one assembly to another.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.