zoukankan      html  css  js  c++  java
  • 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);
                }else
                     result = 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异常的处理及文件的写入
    • 上周博客互评情况

    其他

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

    学习进度条

    代码行数(新增/累积) 博客量(新增/累积) 学习时间(新增/累积) 重要成长
    目标 5000行 30篇 400小时
    第一周 200/200 2/2 20/20
    第二周 300/500 1/3 18/38
    第三周 500/1000 1/4 22/60
    第四周 300/1300 1/5 30/90
    第五周 700/ 2000 1/6 30/120
    第六周 792/2792 1/7 30/150
    第七周 823/3559 1/8 30/180
    第八周 774/4333 3/9 30/ 210
    第九周 426/4759 2/11 30/ 240

    参考资料

  • 相关阅读:
    setsid
    dup
    信号量
    linux标准输入输出
    linux守护进程范例
    c++字符串操作
    浏览器缓存
    bfc
    苹果手机自制铃声
    vue-cli 源码解读
  • 原文地址:https://www.cnblogs.com/20172307hyt/p/9032883.html
Copyright © 2011-2022 走看看