這是我的一個練習的代碼:
Module Module1
Sub Main()
Dim a_row As New ArrayList
Dim x As Integer = 1
For a As Integer = 0 To 3
Dim a_col As New List(Of Integer)
For b As Integer = 0 To 4
a_col.Add(x)
x = x + 1
Next
a_row.Add(a_col)
Next
For i As Integer = 0 To a_row.Count - 1
For j As Integer = 0 To a_row(i).count - 1
Debug.Print("{0} type:{1}", a_row(i)(j), TypeName(a_row(i)(j)))
Next
Next
End Sub
End Module
如果設定Option Strict On的情況下,編譯器都會對a_row(i),a_row(i)(j)這樣的地方報錯“不允許后期系結”,這個問題除了設定Option Strict Off還有別的辦法么?另外我這里a_col用的是泛型的List,已經指定了元素為integer型別了,還存在隱式轉換的問題么?
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/132209.html
標籤:VB.NET
