三、接口實現多態:接口名可用來聲明引用變量。調用接口變量時只能調用接口中定義的方法,由於編譯器只能斷定對象是接口類的,子類自定義的方法沒法響應。html
五、I/O異常(其中還有老師上課講的把數據寫入文本,和從文本中讀取數據內容)
三種標準I/O流(in、out、err)
可檢測的IOExceptions異常java
問題一解決方法:這個問題出現是由於我理解題目出現了問題,檢測到輸入得單詞爲「DONE」就中止,而後判斷總輸入字符串是否超過長度20個,若是是,就拋出異常。無異常的話能夠再次輸入。git
問題二解決方法:剛聽完IO的問題要嘗試去編寫IO的代碼,對應的writer和reader什麼的不瞭解,不過能夠參考參考學長學姐的代碼。代碼中有BufferedOutputStream和BufferedInputStream兩種可供理解,兩種字節流可使用,進行往文件裏面寫入讀出。算法
問題三解決辦法:最後找到string.split方法,以某一特殊符爲界,分割字符串後將每一部分存入數組。數組
(statistics.sh腳本的運行結果截圖)數據結構
錯題1: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.在程序的某個位置集中處理異常。函數
錯題2: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
解析:調用oop
錯題3: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學習
錯題4:We compare sorting algorithms by examining
A the number of instructions executed by the sorting algorithm
B the number of instructions in the algorithm itself (its length)
C the types of loops used in the sorting algorithm
D the amount of memory space required by the algorithm
E whether the resulting array is completely sorted or only partially sorted
分析:這道題考到的知識點爲:不一樣的排序算法在執行時須要不一樣數量的指令。因此咱們經過檢查排序算法執行的指令數,來比較排序算法。因此應該選a。ui
錯題5:Polymorphism is achieved by
A . overloading(重載)
B . overriding(重寫)
C . embedding(嵌入)
D . abstraction(抽象)
E . encapsulation(封裝)
分析:這道題考查的是多態性是經過什麼實現,我選擇的是的抽象,而答案是b重寫:重寫提供了多態性,由於適當的方法是根據當前被引用的對象而調用的,因此應該是重寫實現多態性。
錯題6: All run-time Errors throw Exceptions.
正確答案:B.false
緣由:結果顯而易見,若是咱們用try-catch語句就能夠不拋出了。
錯題7:A try statement must have at least one catch statement, but could have many catch statements, and may or may not have a finally clause.
正確答案:A.true
緣由:點錯了,使用try以後必需要有至少一個catch,至少在IDEA中若是沒有接下來的catch就會出現紅線提示,finally是無關緊要的,有需求就能夠用。
教材學習中的問題和解決過程, 一個問題加1分
代碼調試中的問題和解決過程, 一個問題加1分
基於評分標準,我給本博客打分:11分。得分狀況以下:正確使用Markdown語法+1.教材學習中的問題和解決過程+2.代碼調試中的問題和解決過程+2.感想,體會不假大空+1.錯題學習深刻+1.點評認真,能指出博客和代碼中的問題+1.結對學習狀況真實可信+1.課後題有驗證+1,進度條有記錄+1.
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 30篇 | 400小時 | |
第一週 | 200/200 | 2/2 | 20/20 | |
第二週 | 350/500 | 2/4 | 24/38 | |
第三週 | 512/1000 | 3/7 | 22/60 | |
第四周 | 1158/1300 | 4/9 | 35/90 | |
第五週 | 2905/3000 | 6/5 | 24/24 | |
第六週 | 3927/4000 | 2/2 | 26/30 |