乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      VB實(shí)現(xiàn)抽象類

       玉雪龍山999 2012-02-14

      VB實(shí)現(xiàn)抽象類

      發(fā)布時(shí)間:2008-04-03 10:39:25  來源:CSDN  作者:CSDN  點(diǎn)擊:209

        玩VB已經(jīng)有1個(gè)星期左右了.覺得VB也是可以用OO的方式來開發(fā)應(yīng)用程序的.因?yàn)閂B支持Com并且提供類模塊實(shí)現(xiàn)了封裝.同時(shí)也提供了接口的支持.通過Implements就可以實(shí)現(xiàn)接口.因此也就實(shí)現(xiàn)了繼承.如果

      通過組合就可以達(dá)到繼承的效果.當(dāng)然者應(yīng)該算做Adapter模式了.當(dāng)然可以通過VB實(shí)現(xiàn)大多數(shù)面向?qū)ο蟮脑O(shè)計(jì)模式.并且也可以通過UML進(jìn)行建模.因?yàn)閂B支持引用傳遞消息.同時(shí)大多數(shù)OO特性也可以模擬實(shí)現(xiàn).

        這里我介紹一種抽象類的實(shí)現(xiàn)其實(shí)只是一個(gè)引例.方法很簡單.就是通過接口定制契約.通過Com不可創(chuàng)建對象實(shí)現(xiàn)抽象類的不可創(chuàng)建性.通過Adapter模式模擬繼承實(shí)現(xiàn).

        例子如下:

        ’接口部分
        Public Function AbstructFun() As String
        End Function

        ’不可創(chuàng)建對象(用來實(shí)現(xiàn)抽象方法)把Instancing設(shè)置為 publicNoCreatable
        Implements ImyInterFace
        Public Function ImyInterFace_AbstructFun() As String
        ImyInterFace_AbstructFun = "我起床"
        End Function

        ’實(shí)現(xiàn)部分
        Implements ImyInterFace
        Public Function ImyInterFace_AbstructFun() As String
        Dim ac As New AbstructClass
        ImyInterFace_AbstructFun = ac.ImyInterFace_AbstructFun & "我吃早飯"
        End Function

        本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多