一.复习基础——属性与实例变量 'Fig. 4.8:GradeBookTest.vb 'Create and manipulate a GradeBook object. Module GradeBookTest 'Main begins program execution Sub Main() 'line 8 creates a GrateBook object that is referenced by 'variable gradeBook of type GradeBook Dim gr…
一.代码 ' Fig. 9.7: LINQWithListCollection.vb ' LINQ to Objects using a List(Of String). Module LINQWithListCollection Sub Main() ' populate a List of Strings Dim items As New List(Of String) items.Add("aqua") ' add "aqua" to the end of t…
一.模块代码 ' Fig. 9.4: LINQWithArrayOfObjects.vb ' LINQ to Objects using an array of Employee objects. Module LINQWithArrayOfObjects Sub Main() ' initialize array of employees Dim employees As Employee() = { _ New Employee("Jason", "Red",…
一.模块代码 ' Fig. 9.6: ListCollection.vb ' Generic List collection demonstration. Module ListCollection Sub Main() Dim items As New List(Of String) ' create a new List of Strings items.Add("red") ' append an item to the List items.Insert(0, "ye…
片段代码: ' Exercise 9.3 Solution: Invoice.vb ' Invoice class. Public Class invoide ' declare variables for Invoice object Private partNumberValue As Integer Private partDescriptionValue As String Private quantityValue As Integer Private priceValue As De…
一.主模块代码: 'Fig.4.16:GradeBookTest.vb 'Create and manipulate a GradeBook object;illustrate validation Module GradeBookTest 'Main begins program execution Sub Main() 'creat GradeBook object Dim gradeBook1 As New GradeBook("CS101 Introduction to Visual B…
一.主模块代码: 'Fig.4.13:GradeBookTest.vb 'GradeBook constructor used to specify the course name at the 'time each GradeBook object is created. Module GradeBookTest 'Main begins program execution Sub Main() 'creat GradeBook object Dim gradeBook1 As New Gra…