freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java編程基礎(chǔ)課程-300集史上最全、最深、最細(xì)-wenkub.com

2024-10-14 01:18 本頁面
   

【正文】 ().add(stu)。 // 分揀:根據(jù)班級(jí)編號(hào)查看 Map是否存在該班級(jí) ClassRoom room = (no)。 } public ClassRoom(String no) { this()。 分揀存儲(chǔ) 2 ? 案例 2:定義一個(gè) Student類 ,屬性 :name 姓名 ,no班號(hào) ,score 成績 現(xiàn)在將若干Student對(duì)象放入 List,請(qǐng)統(tǒng)計(jì)出每個(gè)班級(jí)的總分和平均分 ? 面向?qū)ο蠓謷鎯?chǔ) – 丌推薦使用 MapString,ListStudent 操作丌方便 – 推薦使用 MapString,ClassRoom ? 思路 :簡單封裝一個(gè)班級(jí)類即可 班級(jí)類 (代碼片段 ) 分揀操作 (核心代碼 ) /** 班級(jí) */ public class ClassRoom { private String no。 //直接使用容器 (()+1)。 分揀存儲(chǔ) ? 分揀存儲(chǔ) :即分組歸類 包裹如何分揀 分揀存儲(chǔ) ? 案例 1:統(tǒng)計(jì)每個(gè)單詞出現(xiàn)的次數(shù) this is a cat and that is a mice and where is the food ? ? HashMap分揀存儲(chǔ) – 思想 :實(shí)現(xiàn) 1:N 一對(duì)多 (一個(gè)鍵多個(gè)值 ) – 分組 : 一個(gè)鍵一個(gè)容器 思路一 (核心代碼 ) 思路二 (核心代碼 ) //為所有 key創(chuàng)建容器 if(!(temp)){ Letter col = new Letter()。 } } …. } //默認(rèn)為 1:1關(guān)系 MapString,String map =new HashMapString,String()。 ((k = ) == key || (k))) { V oldValue = 。 e != null。 (“弼馬溫 ”)。}} 迭代器使用 ? 通常分為三個(gè)步驟 – 獲取迭代器對(duì)象 – 先檢查 – 再獲取 ArrayListString list = new ArrayListString()。 //判斷是否存在下一個(gè)元素 public boolean hasNext(){ return cursor+1size。 //返回游標(biāo)當(dāng)前位置的元素并將游標(biāo)移動(dòng)到下一個(gè)位置 void remove()。類似于 ” 公交車上的售票員 ” ,售票員關(guān)注公交車上的每個(gè)乘客。 }} 總結(jié) ? 泛型類、方法、接口 ? 通配符 上下限 ? 泛型嵌套 ? 注意 : – 丌能使用基本類型 – 丌能在靜態(tài)屬性上使用泛型 – 泛型沒有多態(tài) – 數(shù)組沒有泛型 ? 重點(diǎn) : 能看懂以下代碼即可 (O(∩_∩)O~) – ListString list =new ArrayListString – MapString,Integer map=new HashMapString,Integer()。 //泛型沒有多態(tài) //AFruit f = new AApple()。 } public class Bjsxt T{ T stu 。 //從外到內(nèi)拆分 = new StudentString()。 (new Fruit(“fruit”))。為什么呢?? public class FooT extends List { public static void main(String[] args) { //上限 FooArrayList f =new FooArrayList。 } } 上限 ? 上限 extends :指定的類型必須是繼承某個(gè)類,或者實(shí)現(xiàn)某個(gè)接口 (丌是用implements),即 =如 – ? extends Fruit – T extends List ? 丌能添加信息 ? 存在以下規(guī)則 ,如 – ListFruit 滿足 List? extends Fruit – List? extends Apple 滿足 List? extends Fruit – List?等同 List? extends Object public void test(List? extends Fruit list){ (new Fruit
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1