Declaration Contexts and Default Access Levels
This article tells which declared elements you can use in other declared elements, and their access levels.
The declaration context of a programming element is the part of the code in which it is declared. Frequently this is a different programming element, which is also known as the container element.
The levels of declaration contexts follow:
- Namespace level – in a namespace (but not in a module, class, structure, or trait)
- Module level – in a module, class, structure, or trait (but not in a procedure or block)
- Procedure level – in a procedure or block
The table that follows shows the default access levels for many declared elements, given their declaration contexts.
|Declared element||Statements||Namespace level||Module level||Procedure level|