Dim a As New 名簿("3年A組") a.Add("茅野", "さくら") a.Add("逢沢", "博己") a.Add("秋庭", "凛") Dim b As New 名簿("3年B組") b.Add("浅井", "雪乃") b.Add("宮沢", "保") b.Add("阿部", "トシエ") Dim c As 名簿
Public Class 名簿 Inherits List(Of 頁) Public Property 標題 As String Public Sub New(標題 As String) Me.標題 = 標題 End Sub Public Overloads Sub Add(姓 As String, 名 As String, Optional 生年月日 As Date? = Nothing) Add(New 頁() With {.姓 = 姓, .名 = 名, .生年月日 = 生年月日}) End Sub Public Class 頁 Public Property 姓 As String Public Property 名 As String Public Property 生年月日 As Date? End Class End Class