Since the array has no elements, the default value (zero) is returned : FirstOrDefault « LINQ « VB.Net Tutorial






Imports System.IO
Imports System.Reflection
Imports System.Linq
Imports System.Xml.Linq

Public Class MainClass
   Public Shared Sub Main

        Dim numbers As Integer() = {}

        Dim firstNumOrDefault = numbers.FirstOrDefault()

        Console.WriteLine(firstNumOrDefault)
   End Sub


End Class








12.8.FirstOrDefault
12.8.1.Since the array has no elements, the default value (zero) is returned