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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News | PayPal Newsroom
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
Forbes - Security
Forbes - Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
Hacker News: Ask HN
Hacker News: Ask HN
H
Heimdal Security Blog
D
Docker
Cloudbric
Cloudbric
P
Privacy International News Feed
S
Security Affairs
TaoSecurity Blog
TaoSecurity Blog
博客园 - 聂微东
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tenable Blog
Scott Helme
Scott Helme
人人都是产品经理
人人都是产品经理
Recent Announcements
Recent Announcements
P
Palo Alto Networks Blog
小众软件
小众软件
L
LINUX DO - 最新话题
美团技术团队
Google Online Security Blog
Google Online Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
The Hacker News
The Hacker News
Webroot Blog
Webroot Blog
T
Tor Project blog
G
Google Developers Blog
A
About on SuperTechFans
Y
Y Combinator Blog
K
Kaspersky official blog
A
Arctic Wolf
量子位
I
InfoQ
V
Visual Studio Blog
T
Troy Hunt's Blog
C
Cybersecurity and Infrastructure Security Agency CISA
J
Java Code Geeks
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - 生活即技术

好久不更新了,忙的惭愧哦,思考一个应用 利用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