Hi有一個名爲read.txt的文件,下面是文件中的數據。如何讀取文件並將數據存儲到字符串數組中
OS:B,A,Linux,Windows 7,Windows
ARCH:32 Bit,64 Bit
Browser:Chrome,Firefox,IE
欲讀取該文件,並希望通過與
吐涎到數據轉換成字符串數組爲每列存儲「:」符號。
例如低於
String a[] = { "A","B","Linux", "Windows 7", "Windows" };
String b[] = { "32 Bit", "64 Bit"};
String c[] = { "Chrome", "Firefox" ,"IE"};
太好了,請給它編碼:) – zerocool 2014-09-12 12:34:29
你知道谷歌嗎?這是一個很好的搜索引擎,可以找到答案。當我谷歌搜索結果的第一個結果給了我一個完美的例子http://stackoverflow.com/questions/19844649/java-read-file-and-store-text-in-an-array。 – Matheno 2014-09-12 12:37:59
你的代碼有什麼特別的問題嗎(你有你的代碼,對吧)? – Pshemo 2014-09-12 12:38:18