Declared Element Characteristics
A characteristic of a declared element is an aspect of that element that affects how code can interact with it. Every declared element has one or more of the following characteristics associated with it:
Data type — the values the element can hold, and how it stores those values. For more information, see Data Type Summary (Visual Basic).
Lifetime — the period of execution time during which the element is available for use. For more information, see How to: Lengthen a Variable's Lifetime.
Scope — the set of all code that can refer to the element without qualifying its name. For more information, see How to: Control the Scope of a Variable.
Access level — the permission for code to make use of the element. For more information, see How to: Control the Availability of a Variable.
Characteristics of the Elements
The following table shows the declared elements and the characteristics that apply to each one.
Element |
Data Type |
Lifetime |
Scope 1 |
Access Level |
---|---|---|---|---|
Variable |
Yes |
Yes |
Yes |
Yes |
Constant |
Yes |
No |
Yes |
Yes |
Enumeration |
Yes |
No |
Yes |
Yes |
Structure |
No |
No |
Yes |
Yes |
Property |
Yes |
Yes |
Yes |
Yes |
Method |
No |
Yes |
Yes |
Yes |
Procedure (Sub or Function) |
No |
Yes |
Yes |
Yes |
Procedure parameter |
Yes |
Yes |
Yes |
No |
Function return |
Yes |
Yes |
Yes |
No |
Operator |
Yes |
No |
Yes |
Yes |
Interface |
No |
No |
Yes |
Yes |
Class |
No |
No |
Yes |
Yes |
Event |
No |
No |
Yes |
Yes |
Delegate |
No |
No |
Yes |
Yes |
1 Scope is sometimes referred to as visibility.
See Also
Concepts
Variable Declaration in Visual Basic