首页 > 其他 > 详细

Some notes in Stanford CS106A(3)

时间:2019-03-10 18:21:57      阅读:138      评论:0      收藏:0      [点我收藏+]

1.If ( str1==str2 ) 

means if str1 and str2 are refers to the same OBJECT.

But when compare string , they are not the same actual object.

So we usually use "str1.equals(str2)" to compare the value of the two strings.

2.encryption  Caesar Cipher

3.RAM----random access memory * everything have an adress 

1 ) Static variables/Const  ( in a special location ) --in the memories to visit at the beginning of program

2 ) Dynamic variables ( use "new" on ) -- the memory that comes for a dynamic called the HEAP.  HEAP goes from the top and goes down.

Garbage collection : It‘s memory from the heap just gets reclaimed when it‘s no longer being used. But Ala you‘re using it , this memory still set aside for you.

3 ) Local variables ( Stack ) -- method or parameters ( that got copied of the values which means it has to live sw in memory ) . Stack from the deep and goes up.

When those variables go out of scope , like the method actually end, or get some closing curly brace, the Stack will AUTO get the memories:

----when variables is no longer use , it will popped off from the stack -- remove from the top. ( automaticlly get de-allocated by the machine. )

技术分享图片

4 ) Stack piont to a location in heap.

技术分享图片

4. Exception (略)

 

Some notes in Stanford CS106A(3)

原文:https://www.cnblogs.com/wleaves/p/10506245.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!