<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中存放數(shù)據(jù)的地方 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中存放數(shù)據(jù)的地方。
    2. 棧的優(yōu)勢是,存取速度比堆要快,僅次于直接位于CPU中的寄存器。但缺點是,存在棧中的數(shù)據(jù)大小與生存期必須是確定的,缺乏靈活性。另外,棧數(shù)據(jù)可以共享,詳見第3點。堆的優(yōu)勢是可以動態(tài)地分配內(nèi)存大小,生存期也不必事先告訴編譯器,Java的垃圾收集器會自動收走這些不再使用的數(shù)據(jù)。但缺點是,由于要在運行時動態(tài)分配內(nèi)存,存取速度較慢。
    3. Java中的數(shù)據(jù)類型有兩種。基本類型(primitive types), 共有8種,即int, short, long, byte, float, double, boolean, char。存在于棧中。另一種是包裝類數(shù)據(jù),如Integer, String, Double等將相應(yīng)的基本數(shù)據(jù)類型包裝起來的類。這些類數(shù)據(jù)全部存在于堆中.

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

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


    網(wǎng)站導(dǎo)航:
    博客園   IT新聞   Chat2DB   C++博客   博問  
     
    主站蜘蛛池模板: 一区二区三区免费在线视频| 国产精品亚洲精品久久精品 | 在线观看免费亚洲| 亚洲大片免费观看| 18禁黄网站禁片免费观看不卡| 久久综合图区亚洲综合图区| 美女视频黄a视频全免费网站色窝| 中文字幕亚洲综合久久男男| 久久九九久精品国产免费直播| 免费又黄又爽又猛的毛片| 午夜亚洲国产精品福利| 五月天婷亚洲天综合网精品偷| selaoban在线视频免费精品| 国产亚洲精品拍拍拍拍拍| 成人毛片100免费观看| 亚洲av无码一区二区三区乱子伦| 无码午夜成人1000部免费视频| 亚洲天堂一区二区三区四区| 免费被黄网站在观看| 美女视频黄频a免费观看| 精品国产人成亚洲区| 免费网站看av片| 亚洲综合久久成人69| 日韩视频免费在线| 成人免费网站视频www| 亚洲av永久无码精品国产精品| 亚洲一级免费视频| 亚洲色无码国产精品网站可下载| 亚洲av成人一区二区三区在线观看 | 国产精品国产免费无码专区不卡| 四虎影视久久久免费观看| 国产亚洲综合一区柠檬导航| 久久成人国产精品免费软件| 亚洲乱亚洲乱妇无码| 自拍偷自拍亚洲精品被多人伦好爽| 久久免费动漫品精老司机| 亚洲中文精品久久久久久不卡| 久久精品国产亚洲Aⅴ香蕉| 久久久久久精品成人免费图片| 日韩亚洲综合精品国产| 亚洲国产精品SSS在线观看AV|