哈毛小子
1.heap是堆,stack是栈。2.stack的空间由操作系统自动分配和释放,heap的空间是手动申请和释放的,heap常用new关键字来分配。3.stack空间有限,heap的空间是很大的自由区。在Java中,若只是声明一个对象,则先在栈内存中为其分配地址空间,若再new一下,实例化它,则在堆内存中为其分配地址。4.举例:数据类型 变量名;这样定义的东西在栈区。如:Object a =null; 只在栈内存中分配空间new 数据类型();或者malloc(长度); 这样定义的东西就在堆区如:Object b =new Object(); 则在堆内存中分配空间
吃不胖的妩媚
pile英 [paɪl] 美 [paɪl] n. 桩;一堆;绒头;摞 vt. 堆起;堆叠;放置;装入 vi. 蜂拥,拥挤 桩; 堆; 大量; 绒毛 复数:piles 过去式:piled 过去分词:piled 现在分词:piling 第三人称单数:piles (上窄下宽的)堆 A pile of things is a mass of them that is high in the middle and has sloping sides....a pile of sand... 一堆沙子...a little pile of crumbs... 一小堆面包屑The leaves had been swept into huge piles. 树叶被扫成了一大堆一大堆的。一个压着一个摆放整齐的)叠,摞 A pile of things is a quantity of things that have been put neatly somewhere so that each thing is on top of the one belowa pile of boxes... 一叠盒子We sat in Sam's study, among the piles of books... 我们坐在萨姆的书房里,身边是一堆一堆的书。The clothes were folded in a neat pile. 衣服叠放成整齐的一摞。accumulate, amass, collect, gather, heap, pile 这些动词均含“积聚,聚集,积累”之意。accumulate:几乎可用于指任何事物量的增加,侧重连续不断地,一点一滴地聚积。amass:着重大量地积聚,尤指对如金钱、珠宝等有价值东西的大量积聚。collect:普通用词,多用于指物,侧重指有区别地作选择或有安排有计划地把零散物集中起来。gather:普通用词,指人或物或抽象事物都可用。侧重于围绕一个中心的集合、聚集。heap:主要指把沙、石、煤、草等堆高,不强调整齐。pile:着重指比较整齐地把东西堆积在一起。1. Collect the books and put them in a pile on my desk. 把书收起来放在我的桌子上。 2. The writer confronted his pile of work with determination. 那作家下决心面对成堆的工作。 3. A sudden wind swept a pile of leaves in. 突然吹起一阵风,刮进一堆树叶来。 4. The little kid stepped right in a pile of dog shit. 这小孩正好踩在一堆狗屎上。 5. I've a pile of papers to get through before the meeting. 开会前我有一大堆文件要处理。
penny900627
区别:stack的空间由操作系统自动分配和释放,heap的空间是手动申请和释放的。stack空间有限,heap的空间是很大的自由区。heap读音 :[hiːp] 释义:堆;许多;累积。堆起来。人名;(芬)海亚普;(东南亚国家华语)协;(英)希普。相关短语:1、heap up 累积 ; 聚集 ; 堆起 ; 积累的2、heap allocation [计] 堆分配 ; 堆积分派 ; 堆分派 ; 堆式分配3、compost heap 堆肥堆 ; 是 ; 一堆混合物 ; 封闭好后院的堆肥箱相关句子:1、Can you tell how many jin of apples there are in this heap?你估一估这堆苹果有几斤。2、Much of this work involves copying objects from one address to another within the heap. 这些工作大多需要在堆内部将对象从一处复制到另一处。stack读音:[stæk]释义:堆;堆叠。使堆叠;把…堆积起来。堆积,堆叠。人名;(英)斯塔克;(德)施塔克相关短语:1、protocol stack [计] 协议栈 ; 协议堆栈 ; 协议簇 ; 通讯协议堆栈2、Stack effect [机] 烟囱效应 ; 建筑物内热空气上升 ; 自拔风3、stack pointer 堆栈指针 ; [计] 栈指针 ; 堆栈指示字 ; 栈指示器