Re: [問題] File.list的排列方是

看板java作者 (null)時間15年前 (2010/04/21 10:59), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《master0101 (master)》之銘言: : File path = new File(./a/); : String[] list = path.list(); : 這兩行程式碼是要把 a 資料夾裡所有檔案的檔名存到list這個字串陣列 : 想請問這個陣列的順序 : 是依照甚麼去排的呢? : 先謝謝大家了~ http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#list() There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.165.131
文章代碼(AID): #1BpcefjG (java)
文章代碼(AID): #1BpcefjG (java)