Translate Into English Coffee & Tea
ASP.NET 中的 AJAX ASP.NET 画图全接触 ASP.NET 与 XML 声明式数据绑定 ASP.NET 网页抓取
C# 基础 C# 类教程 C# 加密 ASP.NET 成员资格 非“自动化”处理 Excel
QuickAjax Ajax 完美的语法高亮器 Silverlight Popfly
通栏广告

ASP 类的功能实在有限,所以有时我们要实现复杂的功能,只好用组合来实现。

class CFish
    sub Swim()
    end sub
end class

class CBird
    sub Fly()
    end sub
end class

class CAnimal
    dim fish
    dim bird

    private sub class_initialize()
        set fish = new CFish
        set bird = new CBird
    end sub
   
    private sub class_terminate()
        set fish = nothing
        set bird = nothing
    end sub
end class

dim animal
set animal = new CAnimal
call animal.fish.Swim() '鱼游
call animal.bird.Fly() '鸟飞
set animal = nothing

相关文章
文章评论
标题:必填
内容:
文章信息