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

正文內(nèi)容

[工學(xué)]六、基礎(chǔ)類庫和工具類庫(參考版)

2025-01-22 11:11本頁面
  

【正文】 } } currentDate=Mon Sep 10 19:40:05 CST 2022 newDate=Thu Jan 01 08:16:40 CST 1970 true false MS since 197011:1189424405234 基礎(chǔ)類庫和工具類庫 54 ?Calendar –抽象類,定義了一系列的成員變量在 Date對象和一組整數(shù)域之間進(jìn)行轉(zhuǎn)換: YEAR, MONTH, DAY, HOUR, … –Calendar的實(shí)例不能通過構(gòu)造方法獲得,一般使用以下方法: –Calendar c = ()。 ((newDate))。 (newDate=+newDate)。 (currentDate=+currentDate)。 –方法 long getTime( ) 獲取自 數(shù) int getDate( ) 獲取 系統(tǒng)當(dāng)前日期 boolean after(Date date) 當(dāng)前對象所含日期是否遲于 date boolean before(Date date) 當(dāng)前對象所含日期時(shí)候早于 date void setTime(long t) 設(shè)置新的時(shí)間 基礎(chǔ)類庫和工具類庫 53 import 。 例: P137排序 基礎(chǔ)類庫和工具類庫 50 ? 掌握 Date ? 掌握 Calendar 4.日期與時(shí)間 基礎(chǔ)類庫和工具類庫 51 ?日期類 類,包括 Date、 Calendar和 GregorianCalender類 ,其中 Date類早在 ,但由于設(shè)計(jì)存在嚴(yán)重缺陷,其中大量方法被廢棄(Deprecated),而被分散到其他類中,因此在使用 Date類的時(shí)候應(yīng)該盡量避免使用這些方法。 public static void sort(List list,Comparator c)。 boolean equals(Object obj)。} 基礎(chǔ)類庫和工具類庫 49 ?查找和排序 首先 小的方法。i()。i++) Object o=(i)。} (2)遍歷 List集合的方法 void enumerate(List list){ for(int i=0。()。) (())。//列舉所有映射 for(Iterator iterator=()。) (())。//列舉所有的值 for(Iterator iterator=()。) (\t+())。//列舉所有關(guān)鍵字 for(Iterator iterator=()。 ((“Rhette”))。 (“Alice”,“育英小學(xué) )。 (“Rhette”,“銀帆公司” )。 import .*。 –關(guān)鍵字和值只能是 String類型,常用于讀去配置信息。 –Map中包括了關(guān)鍵字的集合、值的集合,以及關(guān)鍵字和值的映射關(guān)系。 while(()) //逆向列舉 (“\t”+())。 ListIterator iterator=()。 (4)。 (2)。 public class ListIteratorDemo{ public static void main(String args[]){ List list=new ArrayList()。 import 。 } } 基礎(chǔ)類庫和工具類庫 39 基礎(chǔ)類庫和工具類庫 40 ListIterator是 Iterator的子接口,它針對 List集合有序的特點(diǎn),提供了雙向檢索和元素存取的功能,其方法如下表: void add(E e) Inserts the specified element into the list (optional operation). boolean hasNext() Returns true if this list iterator has more elements when traversing the list in the forward direction. boolean hasPrevious() Returns true if this list iterator has more elements when traversing the list in the reverse direction. Object next() Returns the next element in the list. int nextIndex() Returns the index of the element that would be returned by a subsequent call to next. Object previous() Returns the previous element in the list. int previousIndex() Returns the index of the element that would be returned by a subsequent call to previous. void remove() Removes from the list the last element that was returned by next or previous (optional operation). void set(E e) Replaces the last element returned by next or previous with the specified element (optional operation). 基礎(chǔ)類庫和工具類庫 41 【 例 6. 9】 使用 ListIterator接口列舉集合中的元素。 ()。 Iterator iterator=()。 (new Integer(1))。 (3)。 (1)。 import 。 Method Summary boolean hasNext() Returns true if the iteration has more elements. Object next() Returns the next element in the iteration. void remove() Removes from the underlying collection the last element returned by the iterator (optional operation). 基礎(chǔ)類庫和工具類庫 38 import 。i++) (\tarray[+i+]=+ array[i].toString())。 //將集合轉(zhuǎn)化為數(shù)組 for(int i=0。 //添加重復(fù)元素 (list=+list)。 (new Double())。 (4)。 //添加元素 (2)。 //父接口引用變量指向子類對象。 import .*。 } } This is my family! family=[daughter:Alice, dog:Windy, mathor:Scarlet, father:Rhette] 注意他們出現(xiàn)的順序 ——無序的! 基礎(chǔ)類庫和工具類庫 33 Collection接口的子接口,定義了一個(gè) 有序 元素的集合,在使用上類似動態(tài)數(shù)組 /變長數(shù)組,可存放的元素?cái)?shù)量隨插入操作自動進(jìn)行調(diào)整。 (This is my family!)。 (new Daughter(“daughter:Alice))。 (new Father(father:Rhette))。 } public String toString(){ return name。 } } class Dog{ private String
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1