20182318 2019-2020-1 《数据结构与面向对象程序设计》第2和3周学习总结

20182318 2019-2020-1 《数据结构与面向对象程序设计》第2和3周学习总结

教材学习内容总结

教材第二章内容

  • 学习Java基本数据类型以及数据转换知识;
  • println与print的用法和区别;
  • 转义字符的概念及用法;
  • 运算符(自增自减,赋值,加减乘除模)用法及优先级;
  • 学习Scanner类,编写可输入的程序。
  • 完成课后自测题,以及作业PP2.2,PP2.4,PP2.6等。

第三章内容

1.Random类用来生成随机数
2.Matn主要是基本数学函数,静态方法
3.NumberFormat和DecimalFormat格式化信息输出,printf输出含有数值的格式字符串

4.一个包装器代表一种具体的基本数据类型

教材学习中的问题和解决过程

问题1:静态方法和非静态方法有啥区别?
问题1解决方案:两者的生命周期不同。静态方法的生命周期跟相应的类一样长。而非静态方法的生命周期和类的实例化对象一样长。静态方法可以直接调用,类名调用和对象调用。但是非静态方法只能通过对象调用。

问题2:对转义字符\r与\n的功能区分不清
问题2解决方案:\n表示回车换行;\r表示回车到当前行行首。

代码调试中的问题和解决过程

  • 问题1:没有注意到整数除法无小数

  • 问题1解决方案:经过仔细观察思考解决

  • 问题2:初始化定义连续赋值错误

  • 图片

  • 问题2解决方案:要单个赋值

  • 问题3:静态变量,动态变量引用错误

  • 图片

  • 问题3解决方案:经过百度,搞清楚区别

代码托管

(statistics.sh脚本的运行结果截图)

上周考试错题总结

  • 错题1及原因( 单选题 | 1 分)
    In Java a variable may contain
    A
    .
    a value or a reference
    B
    .
    a package
    C
    .
    a method
    D
    .
    a class
    E
    .
    any of the above
    正确答案: A 你的答案: E
    查看知识点 | 收起解析

Java variables contain values or references to instances of classes (which contain values and/or additional references).

  • 错题2及原因( 单选题 | 1 分)
    If two variables contain aliases of the same object then
    A
    .
    the object may be modified using either alias
    B
    .
    the object cannot be modified unless there's but a single reference to it
    C
    .
    a third alias is created if/when the object is modified
    D
    .
    the object will become an "orphan" if both variables are set to null
    E
    .
    answers A and D are correct
    正确答案: E 你的答案: D
    查看知识点 | 收起解析

By definition, a alias provides a means by which an object can be modified (an alias is like a pointer). By definition, a alias provides a means by which an object can be modified (an alias is like a pointer). If both variables are set to null, then the object is not referenced by any variable (via any alias) and it does, indeed, become an "orphan" and it will be garbage collected at some point in the future.

  • 错题3及其原因 单选题 | 1 分)
    Which properties are true of String objects?
    A
    .
    Their lengths never change
    B
    .
    The shortest string has zero length
    C
    .
    Individual characters within a String may be changed using the replace method
    D
    .
    The index of the first character in a string is one
    E
    .
    Only A and B are true
    正确答案: E 你的答案: D
    查看知识点 | 收起解析

Strings are immutable. That means that once a string object is created it cannot be changed. Therefore the length of a string never changes once it has been created. The shortest length string is "" there are no characters between the quotes, so the length is zero. The replace method allows you to create a new string from an original one, replacing some of the characters. The index of the first location in a String is zero not one. Also, the last byte of every string contains the end-of-string character which is a byte of low-values, or binary zeros.

  • 错题4及其原因What is the function of the dot operator?
    A
    .
    It serves to separate the integer portion from the fractional portion of a floating point number
    B
    .
    It allows one to access the data within an object when given a reference to the object
    C
    .
    It allows one to invoke a method within an object when given a reference to the object
    D
    .
    It is used to terminate commands (much as a period terminates a sentence in English)
    E
    .
    Both B and C are correct
    正确答案: E 你的答案: D
    查看知识点 | 收起解析

The dot operator is appended directly after the object reference, followed by the data or method to which access is desired. In the case of data, the access may be for reading or writing. In the case of a method, the access is to allow one to invoke the method. The dot within a floating point number is a decimal point not a dot operator.

结对及互评

  • 结对学习内容
  • 对一些类和程序包的用法和作用的讨论。
  • 对编写代码过程中出现的问题相互讨论解决。
  • 对书上课后题如何编写的讨论。

点评:

  • 博客中值得学习的或问题:
  • 内容丰富
  • 问题详尽
  • 基于评分标准,我给本博客打分:14分。得分情况如下:
  1. 正确使用Markdown语法(加1分):

  2. 模板中的要素齐全(加1分)

  3. 教材学习中的问题和解决过程, 一个问题加1分

  4. 代码调试中的问题和解决过程, 一个问题加1分

  5. 本周有效代码超过300分行的(加2分)

  6. 其他加分:

    • 排版精美的加一分
    • 进度条中记录学习时间与改进情况的加1分
    • 有动手写新代码的加1分
    • 错题学习深入的加1分
    • 结对学习情况真实可信的加1分

点评过的同学博客和代码

  • 本周结对学习情况
    • 20182333

    • 结对照片

    • 结对学习内容

      • XXXX
      • XXXX
      • ...
  • 上周博客互评情况

其他(感悟、思考等,可选)

学习还需下真功夫

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
第三周 453/1000 3/7 22/60

尝试一下记录「计划学习时间」和「实际学习时间」,到期末看看能不能改进自己的计划能力。这个工作学习中很重要,也很有用。
耗时估计的公式:Y=X+X/N ,Y=X-X/N,训练次数多了,X、Y就接近了。

参考:软件工程软件的估计为什么这么难软件工程 估计方法

  • 计划学习时间:24小时

  • 实际学习时间:20小时

  • 改进情况:

(有空多看看现代软件工程 课件
软件工程师能力自我评价表
)

参考资料

posted @ 2019-09-22 22:50  J~oker  阅读(213)  评论(1编辑  收藏  举报