In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the "detailed explanation of the basic concepts of the life cycle of VB.NET variables". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the basic concepts of the life cycle of VB.NET variables".
VB.NET variable life cycle
As programmers know, a decorated Shared has been added to VB.NET. The Shared keyword indicates that one or more declared programming elements will be shared. The point is that shared elements are not associated with a specific instance of a class or structure. You need to access shared elements by using the class name or structure name or the variable name of a specific instance of the class or structure to qualify the shared elements. The simple description is that the Shared variable serves the type itself, not a specific object.
An example of Shared
Public Class TestA Public Shared i As Int32 = 10 End Class Public Class TestB Inherits TestA 'inherit TestA Public Sub New () TestA.i = 100' access the Shared variable End Sub End Class using the name of the type
When learning the life cycle of VB.NET variables, it should be noted that the relationship between Shared variables and types and instances in VB.NET does not seem to be particularly strict. Programmers can use instances of types to access and modify Shared variables, but they are very strict in C#.
Assignment statement
Assignment statements in VB.NET are divided into simple assignment statements, compound assignment statements, delegation assignment statements and Mid assignment statements.
Simple assignment statement
Simple assignment statements are basically not much different from previous VB assignment statements, except that VB.NET now allows you to assign values immediately after a variable is declared (you can see the example in the previous accessibility example). What we need to focus on is the declaration and assignment of the array.
In VB.NET, when you declare an array, you can describe both the latitude and the upper limit of the array, and the lower limit of the latitude of each array is 0, which cannot be changed. However, you can specify a zero-length array by specifying the upper limit of the array to-1. This array does not contain any elements.
If the length of the array is not displayed, you can assign a value immediately while declaring the array.
Examples of declaration and assignment of array
Public Class TestA Dim iArr () As Int32 Dim bArr (5) As Boolean'5 refers to the upper limit of bArr subscript, that is, there can be six elements Dim lArr () As Long = New Long (3) {100,200,300,400} Dim cArr () As String = New String () {"A", "B", "C"} Dim dArr (- 1) As Double End Class. Thank you for your reading. The above is the content of "detailed explanation of the basic concept of the life cycle of VB.NET variables". After the study of this article, I believe you have a deeper understanding of the basic concept of the life cycle of VB.NET variables, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.