扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:Crystal编译 来源:yesky 2007年11月11日
关键字:
Listing 9: Extending a class Imports System Class Employee Dim salary As Decimal = 40000 Dim yearlyBonus As Decimal = 4000 Public Sub PrintSalary() ' print the salary to the Console Console.Write(salary) End Sub End Class Class Manager: Inherits Employee End Class |
Class Manager Inherits Employee End Class |
Listing 10: 初始化Manager对象 Class Employee Public salary As Decimal = 40000 Public yearlyBonus As Decimal = 4000 Public Sub PrintSalary() ' print the salary to the Console Console.Write(salary) End Sub End Class Class Manager: Inherits Employee End Class Module Module1 Public Sub Main() Dim manager As Manager manager = New Manager() manager.PrintSalary() End Sub End Module |
Listing 11: Adding a method to the derived class Class Manager: Inherits Employee Public Sub PrintBonus() Console.Write(yearlyBonus) End Sub End Class |
Listing 12: Extending System.Windows.Forms.Form Public Class MyForm : Inherits System.Windows.Forms.Form End Class |
Listing 13: NotInheritable Class Calculator End Class |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者