您好在eclipse中部署了以下代码
//import cs1.Keyboard;
import java.util.*;
import java.io.*;
public class Parser
{
public static void main (String[] args) throws IOException
{
String [][] addyArray = new String[50][4];
for (int j=0; j<50; j++)
{
for (int k=0; k<4; k++)
{
addyArray[j][k] = "
";
}
}
FileReader inFile = new FileReader ("sample.txt");
BufferedReader in = new BufferedReader (inFile);
String line = "";
int i = 0, a = 0;
while(in.ready())
{
line = in.readLine();
while (line != null && line != "
")
{
addyArray[i][a] = line;
line = in.readLine();
a++;
if (line == null) line = "
";
}
i++;
a = 0;
}
for(int j=0; j<3; j++)
{
for(int k=0;k<4;k++)
{
System.out.println((j+1) + "-" + (k+1) + " " + addyArray[j] [k]);
}
}
}
}
我在此行得到以下错误FileReader inFile = new FileReader(“ sample.txt”);
at java.io.FileInputStream.(Unknown Source)
at java.io.FileInputStream.(Unknown Source)
at java.io.FileReader.(Unknown Source)
at Parser.main(Parser.java:19)
我将sample.txt文件放在了上面的源代码文件所在的包文件夹中.我不确定为什么会收到此错误.你能帮我一下吗.谢谢