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

正文內(nèi)容

第七章輸入輸出-資料下載頁

2025-07-20 15:39本頁面
  

【正文】 ile。 myFile=new File(“mymotd”)。 myFile = new File(“\”,”mymotd”)。 … 30 文件測試與實(shí)用方法 ?文件名 String getName( ) String getPath( ) String getAbsolutePath( ) String getParent( ) boolean renameTo( File newName) ?文件測試 boolean exists( ) boolean canWrite( ) boolean canRead( ) boolean isFile( ) boolean isDirectory( ) boolean isAbsolute( ) 31 隨機(jī)存取文件 例:從 zip文件中讀取特定文件 32 隨機(jī)存取文件類 RandomAccessFile 創(chuàng)建隨機(jī)存取文件: myRAFile = new RandomAccessFile(String name, String mode)。 myRAFile = new RandomAccessFile(File file, String mode)。 常用的方法: 數(shù)據(jù)讀寫方法; long getFilePointer( )。 //返回當(dāng)前文件指針 void seek( long pos )。 // 文件指針定位到指定位置 long length( )。 // 返回文件長度 “r”,”w”,”rw” 33 對象輸入 /輸出流 ?把對象保存到外存,稱為永久化。 ?實(shí)現(xiàn) /輸出。 ?只有對象的數(shù)據(jù)被保存,方法與構(gòu)造函數(shù)不被保存。 ?以 transient關(guān)鍵字標(biāo)記的數(shù)據(jù)不被保存。 Public class MyClass implements Serializable { public transient Thread myThread 。 Private transient String customerID。 private int total。 … } 34 輸出對象 Public class SerializeDate { SerializeDate( ){ Date d = new Date( )。 try { FileOutputStream f = new FileOutputStream(“”)。 ObjectOutputStream s= new ObjectOutputStream(f)。 (d)。 ( )。 }catch( IOException e){ ( )。 } } public static void main(String args[]){ SerializeDate b = new SerializeDate()。} } 在 , 實(shí)現(xiàn)了 ation接口 35 輸入對象 Public class UnSerializeDate{ UnSerializeDate(){ Date d = null 。 try { FileInputStream f = new FileInputStream(“”)。 ObjectInputStream s = new ObjectInputStream(f)。 d = (Date) ()。 ()。 }catch(Exception e){ () 。} } public static void main(String args[]){ UnSerializeDate a =new UnSerializeDate()。 } }
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1