作者jtmh (Believing is seeing! ^^)
看板java
标题Re: [问题] 字串阵列存放 readLine() 的问题
时间Fri Aug 25 15:24:35 2006
※ 引述《James0315 (...)》之铭言:
: 我是想要把从txt中读出来的东西放进去string阵列中
: FileReader fin = new FileReader("123.txt");
: BufferedReader lnr = new BufferedReader(fin);
: String[] s = new String[100];
: int i = 0;
: while(str != null)
^^^
cannot find symbol // 你宣告在回圈内
: {
: String str = lnr.readLine();
: s[i] = str; <-------------------这一行错了
: i++;
: }
: 我这样写会出现下面的错误
: found : java.lang.String
: required: java.lang.String[]
: 想请教一下各位大大 readLine方法读进来的资料不是string型态吗?
: 怎麽不能放进去string阵列中呢?
在更正前述错误後重新编译,
并未出现如你所说的错误耶!? (编译成功 @@)
: PS:刚接触JAVA很多地方不懂的新手
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.113.96.157