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

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

教材学习内容总结

1、对类和对象进一步的了解。
2、学习静态类和静态方法。
3、学习类之间不同类型的关系。
4、学习方法的设计及重载。
5、学习了如何调试。

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

  • 问题1:为什么有的变量可以重名?
  • 问题1解决方案:在方法内声明的局部变量可以和在类一级声明的实例变量有同样的名字。
  • 问题2:方法重载的用处是什么?
  • 问题2解决方案:方法可能面临会有不用的参数列表,这时会用到重载,方便调用。

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

  • 问题1:定义变量错误,显示非法表达式。

  • 问题1解决方案:private是java中封装的关键字,实例变量应声明为私有的,所以开头要加上private。
  • 问题2:类有错误,显示方法声明无效。

  • 问题2解决方案:将类名改为与文件名相同。
  • 问题3:访问方法有误
  • 问题3解决方案:访问方法名中变量首字母应为大写。

代码托管

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

上周考试错题总结

  • 错题1
    The instruction super( ); does which of the following?
    A .calls the method super as defined in the current class
    B .calls the method super as defined in the current class'parent class
    C .calls the method super as defined in java.lang
    D .calls the constructor as defined in the current class
    E .calls the constructor as defined in the current class'parent class
    答案:A
    解析:instruction super表示对当前类的父类中某些内容的调用。因为除了super()之外没有消息,所以它是对父类构造函数的调用。

  • 错题2
    All classes in Java are directly or indirectly subclasses of the ________ class.
    A .Wrapper
    B .String
    C .Reference
    D .this
    E .Object
    答案:E
    解析:Java要求所有类都有父类。如果一个类没有扩展另一个类,那么默认情况下,它会扩展对象类。所以对象类是Java中所有其他类的父类或父类。

  • 错题3
    Which of the following is not a method of the Object class?
    A .clone
    B .compareTo
    C .equals
    D .toString
    E .all of the above are methods of the Object class
    答案:B
    解析:对象类定义克隆来创建任何对象的副本,等于确定两个对象是否是同一个对象,并tostring将对象翻译成字符串。但是,compareTo不是按对象实现的,必须在任何要实现可比较接口的类中显式实现。
  • 错题4
    Which of the following is true regarding Java classes?
    A .All classes must have 1 parent but may have any number of children (derived or extended) classes
    B .All classes must have 1 child (derived or extended) class but may have any number of parent classes
    C .All classes must have 1 parent class and may have a single child (derived or extended) class
    D .All classes can have any number (0 or more) of parent classes and any number of children (derived or extended) classes
    E .All classes can have either 0 or 1 parent class and any number of children (derived or extended) classes
    答案:A
    解析:Java支持继承,但不支持多重继承,因此Java类可以有任意数量的子节点,但只有一个父级。此外,由于所有Java类都直接或间接从对象类继承,所以所有Java类都只有一个父类。
  • 错题5
    Two children of the same parent class are known as
    A .aliases
    B .relatives
    C .clones
    D .brothers
    E .siblings
    答案:E
    解析:同一父母的两个孩子之间的关系被称为兄弟姐妹(兄弟会暗示性别)。克隆是同一个对象的副本,别名是同一个对象。在Java中,兄弟和亲戚不被用来定义类之间的关系。
  • 错题6
    Which of these is correct?
    A .a base class is a parent class or super class
    B .a base class is a child class or derived class
    C .a child class is a super class of its parent
    D .a parent class is a subclass of its child
    E .none of the above
    答案:A
    解析:术语、基类、父类、超类是彼此的同义词。它们都暗示该类将被用作继承的基础,随后的类将扩展(继承)基类。

结对及互评

  • 基于评分标准,我给本博客打分:15分。得分情况如下:
  1. 正确使用Markdown语法(加1分):
  2. 模板中的要素齐全(加1分)
  3. 教材学习中的问题和解决过程,加4分
  4. 代码调试中的问题和解决过程, 一个问题加3分
  5. 本周有效代码超过300分行的(加2分)
  6. 其他加分:3

点评模板:

  • 博客中值得学习的或问题:
    • 内容详实且精简
    • 问题充分且已解决
    • 有配图
  • 代码中值得学习的或问题:
    • 正确且简练
    • 方法多样很值得学习

点评过的同学博客和代码

  • 本周结对学习情况
    • 20182322

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

      1、这两周学的内容开始逐渐变难了,有点跟不上,但是多抽出点空闲时间还是能够学到更多东西的,第四周,我尽量抽出更多的时间去敲代码。
      2、多敲一敲课本上的代码,累计代码量,打好基础。

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 5000行 30篇 400小时
第一周 200/200 2/2 20/20
第二周 300/500 2/4 18/38
第三周 500/1000 3/7 22/60
第四周 300/1300 2/9 30/90

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

扫描二维码关注公众号,回复: 7401034 查看本文章

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

  • 计划学习时间:30小时

  • 实际学习时间:25小时

  • 改进情况:

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

参考资料

猜你喜欢

转载自www.cnblogs.com/monsterhunter/p/11614395.html