<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 3, comments - 0, trackbacks - 0, articles - 7

    編程基礎

    Posted on 2011-05-31 11:21 zuora 閱讀(90) 評論(0)  編輯  收藏

    Fieldproperty都屬于面向對象方法學中的屬于——“狀態”,與“行為”相對。



    Field 又稱為域,instance level
    field
    又稱為成員變量;class
    level field
    又稱為靜態變量;


    Property 又稱為屬性,instance level稱為成員屬性,class level
    properties
    稱為靜態屬性。


    Note: Apex Using Static Properties


    When a property is declared as
    static, the property's accessor methods execute in a static context. This means
    that the accessors do not have access to non-static member variables defined in
    the class.


    Java Action Script或者Apex編程語言中,屬性(Property)會以不同樣式的GetterSetter形式存在。


    如在Java中,Property定義方式遵照JavaBean的命名規范如下:







        public
    int
    getWidth() {


            return this.measuredWidth;


       
    }


       


       
    public
    void
    setWidth(
    int
    width) {


            this.explictWidth = width;


            invalidteProperties();


       
    }



    Action
    Script
    中,Property可以定義如下:







        public
    function get width():Integer {


            return this.measuredWidth;


       
    }


       


       
    public
    function
    set
     width(var width:Integer):void {


            this.explictWidth = width;


            invalidteProperties();


       
    }



    Apex中,Property定義如下:







        public
    Integer width {


         get
    {


               return this.measuredWidth;


       
       }


    set
    {


                this.explictWidth = width;


                invalidteProperties();


       
        }


    }



    Java編程中對屬性值的設置,通常通過調用Setter完成,如下:








    ...


    object.setWidth(10);


    ...




    而在Action Script或者Apex編程語言中,可以通過對屬性名稱直接賦值完成,如下:








    ...


    object.width = 10;


    ...



    上述一次賦值操作將導致調用一次widthsetter方法。



    給出PropertySample Code是為了讓初學者更清楚FieldProperty的區別與聯系。


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲精品视频免费在线观看| 亚洲免费在线观看| 亚洲AV成人片无码网站| 亚洲七七久久精品中文国产| 无码人妻一区二区三区免费看| 色老板亚洲视频免在线观| 亚洲国产精品成人| 2015日韩永久免费视频播放 | 永久免费观看黄网站| 亚洲一区二区影院| 国产99视频精品免费视频7| 中文字幕日本人妻久久久免费| 精品久久亚洲中文无码| 亚洲午夜久久久久久噜噜噜| 毛片网站免费在线观看| 免费一区二区无码东京热| 久久人午夜亚洲精品无码区| 亚洲AV无码成人精品区在线观看| 日本免费一区尤物| 2019中文字幕免费电影在线播放| 一个人看的www免费在线视频 | 日本不卡免费新一区二区三区| 亚洲GV天堂无码男同在线观看| 亚洲AV无码成人精品区天堂| 亚洲日韩在线中文字幕第一页| 成人奭片免费观看| 久久久久久久岛国免费播放 | 久久精品亚洲乱码伦伦中文| 一级女人18毛片免费| a级毛片毛片免费观看永久| 亚洲丁香婷婷综合久久| 亚洲最新在线视频| 亚洲国产精品VA在线看黑人| 午夜亚洲国产成人不卡在线| 成人au免费视频影院| 曰批全过程免费视频网址| 久久99青青精品免费观看| 韩国免费A级毛片久久| 色视频在线观看免费| 亚洲人成网站999久久久综合| 亚洲一区二区三区在线|