欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

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

发布时间:2024/1/17 编程问答 76 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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简介, 流的基本概念)

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

  • PP12.1还算顺利吧,就一开始找思路的时候不太清楚要在哪用到递归
  • 解决方式:最后找到方法在左加右减的那里做递归。代码如下:
static boolean pal(int left, int Right, String str) {boolean result = true;if (str.charAt(left) == str.charAt(Right) && left < Right) {left++;Right--;pal(left, Right, str);}elseresult = false;return result;
  • PP12.9没有想到该怎样储存数据
  • 在参考赵晓海同学的想法后用二维数组来储存,自己一直没想到二维数组,以后要加深理解。

代码托管

上周考试错题总结

  • 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
    • 对四则运算的进一步讨论!对IO异常的处理及文件的写入
  • 上周博客互评情况
    • 20172311

其他

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

学习进度条

代码行数(新增/累积)博客量(新增/累积)学习时间(新增/累积)重要成长
目标5000行30篇400小时
第一周200/2002/220/20
第二周300/5001/318/38
第三周500/10001/422/60
第四周300/13001/530/90
第五周700/ 20001/630/120
第六周792/27921/730/150
第七周823/35591/830/180
第八周774/43333/930/ 210
第九周426/47592/1130/ 240

参考资料

  • 《Java程序设计与数据结构教程(第二版)》

  • 《Java程序设计与数据结构教程(第二版)》学习指导
  • Java Stream简介, 流的基本概念

转载于:https://www.cnblogs.com/20172307hyt/p/9032883.html

总结

以上是生活随笔为你收集整理的20172307 2017-2018-2 《程序设计与数据结构》第9 周学习总结的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。