JAVA I/O 裏面的東西,自己翻譯下,順便練習英語

The FileOutputStream class also has a protected finalize() method that's invoked before
a FileOutputStream object is garbage-collected. This method ensures that files are properly
flushed and closed before the file output stream that opened them is garbage-collected. You
normally don't need to invoke this method explicitly. If you subclass FileOutputStream and
override finalize(), the subclass's finalize() method should invoke this finalize()
method by calling super.finalize().

FileOutputStream類有一個finalize()方法,聲明爲protected,這個方法在FileOutputStream對象被回收之前被調用。這個方法保證文件在打開的文件輸出流被回收之前已經正確寫入並且被關閉。這個方法不需要被直接調用,但是如果你繼承了FileOutputStream並且重載了finalize()方法,那被覆蓋的finalize()需要使用super.finalize()來調用父級的該方法。

I often find it useful to be able to open an arbitrary file and interpret it in an arbitrary fashion.

這句話怎麼翻譯哦?不是很清楚。

大概這裏ARBITRARY表示隨機的意思:我發現打開一個任意的文件並且一任意一種方式打開它???不知道對不對,不清楚,等以後技術高點就知道了,哈哈哈哈

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章