An Integer in VB.NET is a value type. If you try to set it to Nothing (there is no null in VB.NET) then it takes its default value, which for an Integer is zero.
You can use a Nullable(Of Integer) instead, which can also be written as Integer?.
As a demonstration:
Option Infer On
Option Strict On
Module Module1
Sub Main()
Dim myArray As Integer?() = {1, 5, 16, 15}
For j = 1 To 3
For i = 0 To UBound(myArray)
If myArray(i).HasValue Then
myArray(i) = Nothing
Exit For
End If
Next i
' show the values...
Console.WriteLine(String.Join(", ", myArray.Select(Function(n) If(n.HasValue, n.Value.ToString(), "Nothing"))))
Next
Console.ReadLine()
End Sub
End Module
Outputs:
Nothing, 5, 16, 15
Nothing, Nothing, 16, 15
Nothing, Nothing, Nothing, 15
If you are interested in the difference from C# see, e.g., Why can you assign Nothing to an Integer in VB.NET?
myArray?