我的一点想法
所在版块:求学狮城 发贴时间:2003-08-27 23:42  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
1. the three parts of for loop
part I: initialization
part II: governing condition (for the loop to continue)
part III: post condition, i.e. what's going to happen after each loop
however, ++i requires that increase i by 1 before entering a loop, this conflict with part III definition.

2. because the way float(double) numbers are represented in computer, u will find some floating point computing "wrong": 0.5 + 0.2 /= 0.7.

3. if (even==true)
in C, you can write if (var = somevalue), which will assign somevalue to var and return true, but in java, this is not allowed.

4. even = number%2==0 <==> even = (number%2==0)
sequence of actions taken by computer:
(1) computer number%2
(2) compare the previous result and 0 and return comparision result as a boolean value
(3) assign the boolean value to even.

其实每个问题都有想对应的理论(或者说术语)来解释的, 不过我一时间都想不起来是什么, 希望你大概明白吧。
如有纰漏,敬请各位更正。
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
不好意思,还想问学长几个问题~~ tonymmm   (607 bytes , 561reads )
Come in please duck   (1524 bytes , 275reads )
我的一点想法 我心为谁动   (962 bytes , 345reads )
第一个问题 我心为谁动   (64 bytes , 283reads )
嗯嗯,很有道理... tonymmm   (50 bytes , 199reads )