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

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

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

    隨筆-295  評論-26  文章-1  trackbacks-0
    Stack. ?用來在ram中存放數據的地方 This ? lives ? in ? the ? general ? RAM ? (random-access ? memory) ? area, ? but????has ? direct ? support ? from ? the ? processor ? via ? its ? stack ? pointer. ? The ? stack ? pointer ? is ? moved ? down ? to ? create ? new ? memory ? and ? moved ? up ? to ? release ? that ? memory. ? This ? is ? an ? extremely ? fast ? and ? efficient ? way ? to ? allocate ? storage, ? second ? only ? to ? registers. ? The ? Java ? compiler ? must ? know, ? while ? it ? is ? creating ? the ? program, ? the ? exact ? size ? and ? lifetime ? of ? all ? the ? data ? that ? is ? stored ? on ? the ? stack, ? because ? it ? must ? generate ? the ? code ? to ? move ? the ? stack ? pointer ? up ? and ? down. ? This ? constraint ? places ? limits ? on ? the ? flexibility ? of ? your ? programs, ? so ? while ? some ? Java ? storage ? exists ? on ? the ? stack ? ?in ? particular, ? object ? handles ? ?Java ? objects ? are ? not ? placed ? on ? the ? stack. ? ?
    ? ?
    ? Heap. ? This ? is ? a ? general-purpose ? pool ? of ? memory ? (also ? in ? the ? RAM ? area) ? where ? all ? Java ? objects ? live. ? The ? nice ? thing ? about ? the ? heap ? is ? that, ? unlike ? the ? stack, ? the ? compiler ? doesn't ? need ? to ? know ? how ? much ? storage ? it ? needs ? to ? allocate ? from ? the ? heap ? or ? how ? long ? that ? storage ? must ? stay ? on ? the ? heap. ? Thus, ? there's ? a ? great ? deal ? of ? flexibility ? in ? using ? storage ? on ? the ? heap. ? Whenever ? you ? need ? to ? create ? an ? object, ? you ? simply ? write ? the ? code ? to ? create ? it ? using ? new ? and ? the ? storage ? is ? allocated ? on ? the ? heap ? when ? that ? code ? is ? executed. ? And ? of ? course ? there's ? a ? price ? you ? pay ? for ? this ? flexibility: ? it ? takes ? more ? time ? to ? allocate ? heap ? storage.??
    . 棧(stack)與堆(heap)都是Java用來在Ram中存放數據的地方。
    2. 棧的優勢是,存取速度比堆要快,僅次于直接位于CPU中的寄存器。但缺點是,存在棧中的數據大小與生存期必須是確定的,缺乏靈活性。另外,棧數據可以共享,詳見第3點。堆的優勢是可以動態地分配內存大小,生存期也不必事先告訴編譯器,Java的垃圾收集器會自動收走這些不再使用的數據。但缺點是,由于要在運行時動態分配內存,存取速度較慢。
    3. Java中的數據類型有兩種。基本類型(primitive types), 共有8種,即int, short, long, byte, float, double, boolean, char。存在于棧中。另一種是包裝類數據,如Integer, String, Double等將相應的基本數據類型包裝起來的類。這些類數據全部存在于堆中.

    大盤預測 國富論
    posted on 2007-08-20 13:08 華夢行 閱讀(165) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲国产精品一区二区第一页免 | 9久久免费国产精品特黄| 亚洲无线码一区二区三区| 热久久精品免费视频| 99久久国产免费中文无字幕| 免费一级毛片在线播放放视频 | 亚洲精品无码久久一线| 免费看片A级毛片免费看| 久久久精品2019免费观看| 国产成人高清精品免费观看| 日日摸日日碰夜夜爽亚洲| 亚洲日本va在线观看| 亚洲伊人久久大香线蕉| 亚洲国产二区三区久久| 亚洲VA中文字幕不卡无码| 精品亚洲综合久久中文字幕| 亚洲精品视频免费| 亚洲综合色成在线播放| 国产国拍亚洲精品福利| 亚洲精品无码MV在线观看 | 国产精品亚洲片在线观看不卡| 亚洲裸男gv网站| 亚洲Av无码精品色午夜| 亚洲国产精品网站久久| 亚洲午夜无码毛片av久久京东热| 亚洲综合激情五月丁香六月| 国产精品国产亚洲区艳妇糸列短篇| 国产亚洲福利一区二区免费看| 九九九国产精品成人免费视频| 国内精品一级毛片免费看| 国产成人精品免费午夜app| 精品久久免费视频| 日韩一卡2卡3卡4卡新区亚洲| 久久亚洲AV无码精品色午夜麻豆 | 久久久久亚洲AV成人网人人网站| 国内精品99亚洲免费高清| 亚洲国产高清视频在线观看| 精品一区二区三区无码免费直播| 99在线热播精品免费99热| 日本特黄特色免费大片| 亚洲免费在线视频|