<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 華夢行 閱讀(164) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲综合久久成人69| 日韩精品一区二区亚洲AV观看| 色婷五月综激情亚洲综合| 四虎在线免费视频| 老司机亚洲精品影院无码| 99re6热视频精品免费观看| 亚洲天堂视频在线观看| 91免费国产自产地址入| 亚洲制服丝袜中文字幕| 国产精品爱啪在线线免费观看| 亚洲国产夜色在线观看| 欧美a级在线现免费观看| 亚洲欧美国产欧美色欲| 免费一级肉体全黄毛片| 一级毛片高清免费播放| 亚洲乳大丰满中文字幕| 777爽死你无码免费看一二区| 91亚洲精品视频| 最新中文字幕电影免费观看| 日韩成人精品日本亚洲| 国产自偷亚洲精品页65页| 日本高清免费观看| 亚洲国产精品综合久久20| 国产老女人精品免费视频 | 亚洲人成www在线播放| 手机看片久久国产免费| A级毛片成人网站免费看| 亚洲欧洲久久精品| 国产禁女女网站免费看| 两个人看www免费视频| 亚洲国产精品午夜电影| 亚洲A丁香五香天堂网| 免费国产黄网站在线观看可以下载| 久久精品国产亚洲αv忘忧草| 国产国产成年年人免费看片| 成人爽a毛片免费| 一本色道久久综合亚洲精品蜜桃冫| 亚洲国产精品成人AV无码久久综合影院| 日韩免费高清播放器| 亚洲日韩国产一区二区三区在线 | 中文字幕日韩亚洲|