20172307 2017-2018-2 《程序设计与数据结构》第9 周学习总结

20172307 2017-2018-2 《程序设计与数据结构》第9周学习总结

教材学习内容总结

  • 十一章
    1.异常的定义。和错误不同的是,异常可以抛出,错误代表不可恢复的问题必须进行捕获处理。
    2.try-catch语句:try语句后可以跟一条或多条catch语句。如果try语句后没有catch语句就会出现NullPointException错误。
    3.Finally语句:无论try语句块正常退出或由于抛出异常而推出,都将执行finally语句。
    4.异常的传递:在一处异常没有被处理,异常就会传递到上级方法进行处理。
    5.I/O:三种标准I/O流:(1).System.in标准输入流。(2).System.out标准输出流。(3).System.err标准错误流。
    6.可检测异常与不可检测异常:java中唯一的不可检测异常是RuntimeException类的对象或该类的后代类对象。
  • 十二章
    1.递归是一种编程技术,允许一个方法调用自己以达到最终目的。
    2.无穷递归:方法中包含非递归部分和递归部分,如果没有非递归部分,就会出现无穷递归的情况。
    3.间接递归:一个方法调用其他方法,其他方法中有这个方法,最终也实现了递归,这种情况是间接递归。

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

  • 问题1:对流的概念不太清楚。
  • 问题1解决方案:通过查阅网上的资料对流有了大概的了解。流像是一个管道连接着输入和输出两端,一个留的方向是固定的,他通过占据一定的内存每次传输一定的数据信息。
    流是一个类,传输信息要调用这个类里的方法。
    参考至:(Java Stream简介, 流的基本概念)

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

  • 问题1:XXXXXX
  • 问题1解决方案:XXXXXX
  • 问题2:XXXXXX
  • 问题2解决方案:XXXXXX
  • ...

代码托管

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

上周考试错题总结

  • A Java program can handle an exception in several different ways. Which of the following is not a way that a Java program could handle an exception?
    A . ignore the exception
    B . handle the exception where it arose using try and catch statements
    C . propagate the exception to another method where it can be handled
    D . throw the exception to a pre-defined Exception class to be handled
    E . all of the above are ways that a Java program could handle an exception
    错误:D 正确:E
    解析:java处理异常的三种方式:1.根本不处理异常。2.当异常发生时处理异常。3.在程序的某个位置集中处理异常。
  • An exception can produce a "call stack trace" which lists:
    A . the active methods in the order that they were invoked
    B . the active methods in the opposite order that they were invoked
    C . the values of all instance data of the object where the exception was raised
    D . the values of all instance data of the object where the exception was raised and all local variables and parameters of the method where the exception was raised
    E . the name of the exception thrown
    错误:D 正确:B
    解析:调用
  • An exception that could also arise in the try statement that does not have an associated catch statement is:
    A . ClassNotFoundException
    B . IllegalArgumentException
    C . NegativeArraySizeException
    D . NullPointException
    E . OutOfMemoryException
    错误:A 正确:D
    解析:try语句后没有catch语句会出现NullPointException

    结对及互评

  • 本周结对学习情况

  • 上周博客互评情况
    • 20172311

      其他

      递归还是蛮难的,看例子的时候就十分困难,感觉还是需要继续学习递归。

学习进度条

代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
目标 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

参考资料

猜你喜欢

转载自www.cnblogs.com/20172307hyt/p/9032883.html