⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 library.vb

📁 OOP With Microsoft VB.NET And Csharp Step By Step
💻 VB
字号:
Public Class Library
    Private m_shelf As New BookCollection()
    Public Sub CheckIn(ByVal newBook As Book)
        m_shelf.Add(newBook)
    End Sub
    Public Function CheckOut(ByVal title As String) As Book
        Dim theBook As Book = m_shelf(title)
        m_shelf.Remove(title)
        Return theBook
    End Function

    Public Shared Sub Main()
        Dim aLibrary As New Library()
        aLibrary.CheckIn(New Book("First Book", _
            "Here is the text of the first book."))
        aLibrary.CheckIn(New Book("Second Book", _
            "Here is the text of the second book."))
        Dim firstBook As Book = aLibrary.CheckOut("First Book")
        Console.WriteLine("The text of '{0}' is '{1}'.", _
            firstBook.Title, firstBook.Text)
        aLibrary.CheckIn(firstBook)
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -