59
1
Imports System
2
Imports System.Linq
3
Imports System.Collections.Generic
4
5
6
Public Module Module1
7
Public Sub Main()
8
Dim studentList = New List(Of Student) From {
9
New Student() With {.StudentID = 1, .StudentName = "John", .Age = 13 },
10
New Student() With {.StudentID = 2, .StudentName = "Moin", .Age = 21 },
11
New Student() With {.StudentID = 3, .StudentName = "Bill", .Age = 18 },
12
New Student() With {.StudentID = 4, .StudentName = "Ram", .Age = 20 },
13
New Student() With {.StudentID = 5, .StudentName = "Ron", .Age = 15 }
14
}
15
16
17
Dim avgAge = studentList.Average(Function(s) s.Age)
18
19
Console.WriteLine("Average Age of Student: {0}", avgAge)
20
21
22
End Sub
23
End Module
24
Cached Result
Compilation error (line 2, col 15): Unexpected character '$'
Compilation error (line 3, col 18): Unexpected character '$'
Compilation error (line 6, col 1): Unexpected character '$'
Compilation error (line 10, col 9): Unexpected character '$'
Compilation error (line 10, col 27): Too many characters in character literal
Compilation error (line 10, col 83): Too many characters in character literal
Compilation error (line 16, col 1): Unexpected character '$'
Compilation error (line 20, col 9): Unexpected character '$'
Compilation error (line 20, col 24): Too many characters in character literal
Compilation error (line 24, col 1): Unexpected character '$'
Compilation error (line 25, col 10): Too many characters in character literal
Compilation error (line 26, col 11): Too many characters in character literal
Compilation error (line 30, col 19): Unexpected character '$'
Compilation error (line 30, col 21): Too many characters in character literal
Compilation error (line 30, col 48): Too many characters in character literal
Compilation error (line 1, col 1): A namespace cannot directly contain members such as fields or methods
Compilation error (line 29, col 20): Identifier expected
Compilation error (line 29, col 21): Expected class, delegate, enum, interface, or struct
Compilation error (line 33, col 5): Type or namespace definition, or end-of-file expected
Compilation error (line 3, col 18): Unexpected character '$'
Compilation error (line 6, col 1): Unexpected character '$'
Compilation error (line 10, col 9): Unexpected character '$'
Compilation error (line 10, col 27): Too many characters in character literal
Compilation error (line 10, col 83): Too many characters in character literal
Compilation error (line 16, col 1): Unexpected character '$'
Compilation error (line 20, col 9): Unexpected character '$'
Compilation error (line 20, col 24): Too many characters in character literal
Compilation error (line 24, col 1): Unexpected character '$'
Compilation error (line 25, col 10): Too many characters in character literal
Compilation error (line 26, col 11): Too many characters in character literal
Compilation error (line 30, col 19): Unexpected character '$'
Compilation error (line 30, col 21): Too many characters in character literal
Compilation error (line 30, col 48): Too many characters in character literal
Compilation error (line 1, col 1): A namespace cannot directly contain members such as fields or methods
Compilation error (line 29, col 20): Identifier expected
Compilation error (line 29, col 21): Expected class, delegate, enum, interface, or struct
Compilation error (line 33, col 5): Type or namespace definition, or end-of-file expected