標籤:strong bec AC 意義 -- 第四周 load 二分 ble
20172333 2017-2018-2 《Java程式設計》第8周學習總結教材學習內容
- 多態性應用可以隨時間變化指向不同類型的對象。
- 多態性應用,方法的引用與方法的定義代碼的綁定在運行時執行。
- 引用變數可以指定有繼承關係的任何類的任何對象。
- 調用方法的類型實際取決於對象的類型。
- 介面名可以用於聲明對象引用對象。
代碼調試中的問題和解決過程
代碼託管
(statistics.sh指令碼的運行結果)
上周考試錯題總結
- Which of the following statements is completely true?
A . If a class is declared to be abstract then every method in the class is abstract and must be overridden
B . If a class is declared to be abstract then some methods in the class may have their bodies omitted
C . If a class is declared to be abstract then all methods in the class must have their bodies omitted
D . If a class is declared to be abstract then all the instance variables must be overridden when a concrete class is derived from the abstract base class
答案:B,我選擇了A。
解析:抽象類別中只要含有一個抽象方法即可,並非所有的方法都必是抽象的。
2.Can a program exhibit polymorphism if it only implements early binding?
A . Yes, because one form of polymorphism is overloading
B . No, because without late binding polymorphism
cannot be supported
C . Yes, because so long as the programs uses
inheritance and/or interfaces it supports polymorphism
D . Yes, because early binding has nothing to do with polymorphism
E . none of the above
答案:A,我選擇了D。
解析:方法的重載就是多態的表現。
點評:
-
部落格中值得學習的或問題:
由繼承實現多態性
多態性引用能夠隨時間變化指向不同類型的對象。
對於多態性引用,方法調用與方法定義代碼的綁定在運行時執行。
一個引用變數可以指向有繼承關係的任何類的任何對象。
實際將調用的方法版本取決於對象的類型而不是引用變數的類型。
多態性的實質是,每個類很清楚自己如何完成一個指定的行為,並且從某種意義說,每個類的行為都是相同的,多態制允許具有一致性但又獨特的方式處理類似的對象。
利用介面實現多口實現多態性
介面名可以聲明對象引用變數。
一個介面引用變數可以指向實現該介面的任何類的任何對象。
方法的參數可以是多態性的,,使得方法所接受的參數具有靈活性。
以多態性方式實現的排序演算法可對任何一組可比較的對象排序。
學會使用排序法和插入法。
多態性允許用一致性的方法實現不一致的行為。
學會使用線性搜尋和二分搜尋。
部落格對於知識點的描述很詳細。
- 代碼中值得學習的或問題:
在進行Git commit時的備忘內容有條理且井然有序。
點評過的同學部落格和代碼
- 本周結對學習情況
- 20172330李楠
- 結對照片
- 結對學習內容
- Commit內容豐富值得學習
- 問題及處理方法記錄簡潔明了。
學習進度條
|
程式碼數(新增/累積) |
部落格量(新增/累積) |
學習時間(新增/累積) |
重要成長 |
| 目標 |
5000行 |
30篇 |
400小時 |
|
| 第一周 |
125/125 |
2/2 |
20/20 |
|
| 第二周 |
269/394 |
2/4 |
未知/38 |
|
| 第三周 |
477/920 |
1/5 |
X/X |
|
| 第四周 |
1179/2338 |
1/6 |
-- |
|
| 第五周 |
1131/3154 |
1/7 |
?/? |
|
| 第六周 |
1448/4008 |
1/8 |
?/?? |
|
| 第七周 |
957/4840 |
2/10 |
?/??? |
|
| 第八周 |
1093/5933 |
2/10 |
?/???? |
|
其他(感悟、思考等,可選)四則運算好麻煩。參考資料
JAVA的多態
Java經典排序演算法之插入排序
20172333 2017-2018-2 《Java程式設計》第8周學習總結