20172307 2017-2018-2 《程序设计与数据结构》第9 周学习总结
生活随笔
收集整理的這篇文章主要介紹了
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還算順利吧,就一開始找思路的時候不太清楚要在哪用到遞歸
- 解決方式:最后找到方法在左加右減的那里做遞歸。代碼如下:
- 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/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 |
參考資料
《Java程序設計與數據結構教程(第二版)》
- 《Java程序設計與數據結構教程(第二版)》學習指導
Java Stream簡介, 流的基本概念
轉載于:https://www.cnblogs.com/20172307hyt/p/9032883.html
總結
以上是生活随笔為你收集整理的20172307 2017-2018-2 《程序设计与数据结构》第9 周学习总结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: leetcode-728-Self Di
- 下一篇: 跨域405(Method Not All