惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
S
Securelist
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
N
News and Events Feed by Topic
AI
AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Schneier on Security
Schneier on Security
Attack and Defense Labs
Attack and Defense Labs
Vercel News
Vercel News
腾讯CDC
Google DeepMind News
Google DeepMind News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
量子位
S
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
Cyberwarzone
Cyberwarzone
S
Security Affairs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
T
Tenable Blog
PCI Perspectives
PCI Perspectives
MyScale Blog
MyScale Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
W
WeLiveSecurity
N
News | PayPal Newsroom
P
Proofpoint News Feed
O
OpenAI News
C
CERT Recently Published Vulnerability Notes
B
Blog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy

博客园 - 生活即技术

好久不更新了,忙的惭愧哦,思考一个应用 利用dataTable 排序的解决方法 项目中遇到的一些小问题及解决方法 常用代码 一个com+消息队列的例子 部署Com+ 2004我的爱,2005我的期待 加密解密相关 生成略缩图 论坛在线人数统计代码 上礼拜六犯的愚蠢错误 正则表达式(1) 又一新的分页方法(转帖) 用户控件的使用(二) 用户控件的使用(一) DataList的使用(二)自定义分页的实现 DataList的使用(1) DataGrid的使用(2)自定义分页 DataGrid的使用(1)
生活即技术 · 2004-11-10 · via 博客园 - 生活即技术

类的重写,与多态性

Private Sub Page_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load
        
'在此处放置初始化页的用户代码
        Dim Tcar As New car
        Response.
Write("car of add : Tcar.add(3,4): " & Tcar.add(34))
        
Dim SUBcar As New subcar
        Response.
Write("<Br> subcar of add:subcar.add(4,3): " & SUBcar.add(34& "<br>")
        Response.
Write("类的多态性: Tcar.cha(a as int16,b as int16 ):" & Tcar.Walk(45))
        Response.
Write("<Br>Tcar.cha(a as string,b as string  ) :" & Tcar.Walk("b""d"))

    
End Sub

    
Public Class car
        
Public Overridable Function add(ByVal a As Int16, ByVal b As Int16) As Int32
            
Return (a)
        
End Function

        
Public Function cha(ByVal a As Int16, ByVal b As Int16) As Int16
            
Return a + b
        
End Function

        
Public Function cha(ByVal a As StringByVal c As StringAs String
            
Return a & c
        
End Function


        
Public Function Walk(ByVal Dirs As StringByVal dirs1 As StringAs String
            
Return Dirs & dirs1
        
End Function

        
Public Function Walk(ByVal Dirs As IntegerByVal dirs1 As Int32) As Int32
            
Return Dirs + dirs1
        
End Function

    
End Class

    
Public Class subcar
        
Inherits car
        
Public Overrides Function add(ByVal a As Int16, ByVal b As Int16) As Int32
            
Return a * b
        
End Function

    
End Class