摘要: alibaba一道笔试题:public class TestTryCatch { /** */ public static void main(String[] args) { System.out.println("i的值为。。。" + new TestTryCatch().test()); } private int test() { int i = 1; try { return i; } finally { ++i; System.out.println("finally is Executed…"); } }}答案是:finally is Ex 阅读全文
posted @ 2011-08-12 18:00 jinmengzhe 阅读(636) 评论(6) 推荐(3) 编辑
摘要: 转载地址:http://hi.baidu.com/baixuejiyi1111/blog/item/ebf83824ffdab6b34723e8f9.html1、数据结构的栈和堆 堆栈,实际上堆栈是两种数据结构:堆和栈。 堆和栈都是把一些数据项按序排列的数据结构。2、内存分配中的栈和堆 这里有必要把内存分配:一般情况下程序存放在Rom或Flash中,运行时需要拷到内存中执行,内存会分别存储不同的信息,如下图(数据在内存中的存储图示)所示:0xc0000000 内核虚拟内存 ——有内核使用 栈区 -- 程序运行时用于存放局部变量,可向下延展空间0x40000000 共享库的内存影像 ----程序 阅读全文
posted @ 2011-08-12 16:35 jinmengzhe 阅读(682) 评论(0) 推荐(3) 编辑