【发布时间】:2015-08-01 01:30:29
【问题描述】:
为什么下面的代码在VB.Net中会出现IndexOutOfRangeException:
Dim intNum() As Integer = {1, 2, 3, 4, 5}
Dim tot As Integer
For Each n As Integer In intNum
tot = tot + intNum(n)
Next
MsgBox(tot)
【问题讨论】:
-
为什么不应该给出这样的例外?
-
这和 Java 有什么关系?
-
你确定这是 Java 吗?
-
这是(很可能)VB。
标签: .net vb.net indexoutofrangeexception