ALERT

[LAST CHANCE] Data Layer: Modern Business, Defined

Internal

Definition - What does Internal mean?

Internal, in C#, is a keyword used to declare the accessibility of a type or type member such that the access is limited to the assembly in which it is declared.

An internal modifier is used to prevent the use of a public modifier, which allows access to other assemblies wherever necessary. An internal modifier, therefore, is useful in implementing the concept of encapsulation in object-oriented programming at the assembly level. It is used in larger programs where information hiding across program boundaries can improve maintainability and security.

Internal is most often used in component-based development by allowing a specific group of components to communicate in a private manner and prevent access to the code that is not relevant to this group. Internal modifiers enable the access of members of an assembly from the friend assemblies that are designed for specific reasons such as unit testing, extensions to class libraries, etc.

Techopedia explains Internal

Internal is one of the access modifiers that limits the access to types defined within the current project assembly. The default accessibility of classes and structs that are declared within a namespace or at the top level of a compilation unit and not within other types is internal.

For example, while developing a graphical user interface (GUI) application that involves customized GUI elements such as windows, forms, controls, etc., they can be specified with internal accessibility so that they cooperate privately without being exposed to the code that is using these elements.

Referencing a member with internal access from outside the assembly in which it is declared results in a compiler error. While using the internal members of an assembly that need to be accessed from a friend assembly, the name of the friend assembly should be specified with the attribute, InternalsVisibleToAttribute in the assembly where the internal members are defined.

An internal virtual method cannot be overridden in C#.

This definition was written in the context of C#

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Tweat cdn.techopedia.com
"Techopedia" on Twitter


'@Techopedia'
Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Resources
The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.