Características do elemento declarado (Visual Basic)
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:
Tipo de dados — os valores que o elemento pode conter e como ela armazena esses valores. For more information, see Resumo de tipo de dados (Visual Basic).
Lifetime — the period of execution time during which the element is available for use. For more information, see Tempo de vida no Visual Basic.
Scope — the set of all code that can refer to the element without qualifying its name. For more information, see Como: Controlar o escopo de uma variável (Visual Basic).
Access level — the permission for code to make use of the element. For more information, see Como: Controlar a disponibilidade de uma variável (Visual Basic).
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.
Consulte também
Conceitos
Nomes de elementos declarados (Visual Basic)
Níveis de acesso em Visual Basic
Tipos de dados no Visual Basic
Declaração de variável no Visual Basic