第五章和第六章综合总结html
if
、while
、for
、switch
仍是do
,都很好理解。布尔表达式,是条件判断与循环的基础,每个上述语句的利用,都离不开这个。{}
括好。if-else
的简化,本周在教材学习中无重大问题。git
问题1:有史以来最严重的问题,不是技术能解决的数据结构
问题1:PP6.3初步调试,编译未出现问题,但输出乘法表少一行:app
问题1解决方案:如图(将n = 12
修改成n = 13
)ide
问题2:PP5.7,打完代码后调试,出现这个,学习
问题2解决方案:根据多年的学习经验:这个问题在以前几章没有出现过,在这章出现-->这章学了条件判断和循环-->必定是这部分出了问题。发现本身使用的是while(ture)
,却没有使用break
造成死循环,解决方法:加入break
。.net
(statistics.sh脚本的运行结果截图)设计
错题1: Which properties are true of String objects?
正确答案:A .Their lengths never change
B .The shortest string has zero length
缘由:字符串不可变,即其长度不会改变;最短的字符为零如:""
。3d
错题2:What happens if you attempt to use a variable before it has been initialized?
正确答案:A .A syntax error may be generated by the compiler
B .A runtime error may occur during execution
缘由:错选为A,实际上并非全部的未初始化都在编译时被检测出来了。调试
错题3:In the StringMutation program shown in Listing 3.1, if phrase is initialized to "Einstein" what will Mutation #3 yield if Mutation #1: mutation1 = phrase.concat(".")?
正确答案:C .XINSTXIN.
缘由:没有看清题意,因此没有结合例子3.1进行判断,致使错误。
错题4:Consider the following two lines of code. What can you say about s1 and s2?
String s1 = "testing" + "123";
String s2 = new String("testing 123");
正确答案:C .s1 and s2 are both references to different String objects
缘由:s1中间没有空格,而s2有。
错题5:Consider the following enumeration
enum Speed { FAST, MEDIUM, SLOW };
正确答案:C .The name of the Speed enumeration whose ordinal value is zero is FAST
缘由: 枚举型中第一个枚举值的序数值为1。
错题6:You may use the String replace( ) method to remove characters from a String.
正确答案:false
缘由: 同上错题1。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 5000行 | 30篇 | 400小时 | |
第五周 | 260/1549 | 1/9 | 15/110 | 了解到预习的重要性 |
第二周 | 309/504 | 1/5 | 20/40 | 打字速度明显提高 |
第三周 | 311/815 | 2/7 | 25/65 | 无 |
第四周 | 474/1289 | 1/8 | 30/95 | 抗...抗压能力增强? |