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 four characteristics - data type, lifetime, scope, and accessibility - associated with it.
Characteristics of Visual Basic Declared Elements
Every declared element (a programming element that is defined in a declaration statement) has one or more of the following characteristics associated with it:
  • Data type - the values the element can hold, and how those values are stored
  • Lifetime - the period of execution time during which the element is available for use
  • Scope - the set of all code that can refer to the element without qualifying its name
  • Accessibility - the permission for code to make use of the element

The following table shows the declared elements and the characteristics that apply to each one.

Element Data Type Lifetime Scope Accessibility
Variable Yes Yes Yes Yes
Constant Yes No Yes Yes
Enumeration Yes No Yes Yes
Structure No No Yes Yes
Property Yes No Yes Yes
Method No No Yes Yes
Procedure No No Yes Yes
Procedure argument Yes Yes Yes No
Function return Yes Yes Yes No
Event No No Yes Yes
Delegate No No Yes Yes
Interface No No Yes Yes
Class No No Yes Yes

Visibility

The concept of visibility is often mentioned. Visibility results from a combination of lifetime, scope, and accessibility. A programming element can be said to be visible from a block of code when all three of the following conditions apply:

  • The element is within its lifetime - that is, it has been created and not yet terminated.
  • The scope of the element includes the block of code referring to it.
  • The element's accessibility permits the code to use it.